Posts

Showing posts with the label docker

How to create Docker Image and push java app in a Docker Engine

Image
In this blog, I am going to share my knowledge on the creation of a docker image and how can we run in a Docker Engine. Prerequisite Basic Knowledge of Docker Docker must be running on your machine. Good to aware of Spring boot application. I already have one spring boot application in my IntelliJ which expose one endpoint /users/{id}. We will see how can we push and run this application in a docker container.  We need to create one file named Dockerfile to add docker instruction (Check above image). Now go to Terminal and check whether the docker is running or not on your machine. Run docker build to create an image and push it to the container using the command. docker build -f Dockerfile -t docker-spring-ehcache . The above command will execute all the operations that we have mentioned in our Dockerfile like pulling OpenJDK 8 from the docker hub if not exist. Let's see if our image got pushed to docker containers or not by listing all d...