Hello World sample shows how to deploy SpringBoot RESTful web service application with Docker
Optional:
Docker-Compose
Java 1.8 or 11.1
Maven 3.x
$ git clone https://github.com/dstar55/docker-hello-world-spring-boot .
$ docker build -t="hello-world-java" .
Maven build will be executes during creation of the docker image.
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