Hello World sample shows how to deploy SpringBoot RESTful web service application with Docker
Installed: Docker, Java 1.8 or 1.11, Maven 3.x, git, optional Docker-Compose
$ git clone https://github.com/dstar55/docker-hello-world-spring-boot .
$ docker build -t="hello-world-java" .
This will first run maven build to create jar package and then build hello-world image using built jar package.
Note:if you run this command for first time it will take some time in order to download base image from DockerHub
$ docker run -p 8080:8080 -it --rm hello-world-java
$ curl localhost:8080
the respone should be:
Hello World
docker stop `docker container ls | grep "hello-world-java:*" | awk '{ print $1 }'`
Build and start the container by running
$ docker-compose up -d
$ curl localhost:8080
the respone should be:
Hello World
docker-compose down