Start your Spring Boot Service with Docker
- Create a
Dockerfile
in your project.
- Complete docker script in your
build.gradle
- Execute
$ gradle docker build
to create docker image for your project.
- You can use
$ docker images
to view the image you just created.
- Execute the following command to create container by the image.
$ docker run --name "example" -p 8080:8080 -t code.kliangh/spring-boot-docker-example
- Press
ctrl + c
you can stop receiving the console output from container.
- Execute
$ docker ps
to checkout the status of all containers which status is UP.
- Execute
$ docker stop <CONTAINER_NAME>
to stop specific container.
- Execute
$ docker ps -a
will list all container including the status is down.
- Finally, you can use
$ docker rm <CONTAINER_NAME>
to remove container, if you want.
About
Start your spring boot service by using Docker
Languages
Language:Java 100.0%