This guide walks you through the process of building a Docker image for running a Spring Boot application with mongo database.
Docker is a Linux container management toolkit with a "social" aspect, allowing users to publish container images and consume those published by others. A Docker image is a recipe for running a containerized process, and in this guide we will build one for a simple Spring boot application.
If you want to run with Maven, execute:
./mvn package && java -jar target/spring-boot-mongo-docker-1.0.0.jar
and go to http://localhost:8080/customer/ to see your persisted customers.
Congratulations! You’ve just created a Docker container for a Spring Boot app! Spring Boot apps run on port 8080 inside the container by default and we mapped that to the same port on the host using "-p" on the command line.
The following guides may also be helpful: