This project demonstrates how to build an image for a Spring boot rest application using Dockerfile and run it through
docker container.
- GET /hello - Returns a simple greeting message
- Build the application using
mvn clean installand make sure the jar file is present in the Target directory. - Go to the location where
Dockerfileis present. (Current directory in this project). - Build the image for the jar file.:
docker build -t spring-rest . - Running through container :
docker run --name my-container -p 8081:8080 spring-rest
- Access the resource using http://localhost:8081/hello.
- Mayank Sahu (https://github.com/mayank19o7).