Running Spring boot Applications in docker containers
- Java 8
- Spring boot 2.1.5
- Docker version 1.13.1, build 7f2769b/1.13.1
- Maven
- Create a Spring boot application with Maven/ Gradle build. (Here Maven is used)
- Create a DockerFile which will create a docker image
- Build docker image by running following command where your DockerFile is present. (Here is at the root of Project)
docker build -f DockerFile -t hellodocker . - For verifying if image is created, type in following command
docker images
- Run created image by running following command
docker run -p 8081:8081 hellodocker
For getting better clarity of above steps, you can see snapshots folder in hellodocker project