Skip to content

Nesho-Developer/docker-hello-world-spring-boot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello World sample shows how to deploy SpringBoot RESTful web service application with Docker

Prerequisite

Installed: Docker, Java 1.8 or 1.11, Maven 3.x, git, optional Docker-Compose

Steps

Clone source code from git
$  git clone https://github.com/dstar55/docker-hello-world-spring-boot .
Build Docker image
$ 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

Run Docker Container
$ docker run -p 8080:8080 -it --rm hello-world-java
Test application
$ curl localhost:8080

the respone should be:

Hello World

stop docker container:

docker stop `docker container ls | grep "hello-world-java:*" | awk '{ print $1 }'`

Run with docker-compose

Build and start the container by running

$ docker-compose up -d 

test application with

$ curl localhost:8080

the respone should be:

Hello World

stop docker container:

docker-compose down

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 70.6%
  • Dockerfile 29.4%