Prerequisites
- Clone this repo
- Build the application. This will create .jar file inside target folder
- Docker toolbox installed
Steps to run the application
- Open Docker Quickstart Terminal
- Move to the directory where you have cloned the repo in the terminal
docker build -t myimage .
This will create an image from the provided docker file
- List all the images with the command
docker images
- Create and run the container using the image created To see the console
docker run -p 8080:8080 --name webapp myimage
To run in background
docker run -d -p 8080:8080 --name webapp myimage
- Check if container created successfully
docker ps
Failed/stopped containers can be listed bydocker ps -a
- Point you browser to
http://localhost:8080/swagger-ui.html
Log into the running container
docker exec -it <CONTAINER NAME> sh
Cleanup
- Stop container^
docker stop <CONTAINER ID>
- Delete container^
docker rm <CONTAINER ID>
- Delete image^
docker rmi <IMAGE ID>
^ Name can also be used as identifier and you can provide multiple space separated Ids