Docker Cheat Sheet for Spring Developers

Docker Cheat Sheet for Spring Developers


I’ve been playing with Docker a lot recently to deploy Spring Boot applications.  Docker is very cool. I’ve been learning a lot about it.

This is my unofficial Docker Cheat sheet. Use with caution!

Got any tips and tricks? Comment below, and I’ll try to update this.

List all Docker Images

List All Running Docker Containers

List All Docker Containers

Start a Docker Container

Stop a Docker Container

Kill All Running Containers

View the logs of a Running Docker Container

Delete All Stopped Docker Containers

Use -f option to nuke the running containers too.

Remove a Docker Image

Delete All Docker Images

Delete All Untagged (dangling) Docker Images

Delete All Images

Remove Dangling Volumes

SSH Into a Running Docker Container

Okay not technically SSH, but this will give you a bash shell in the container.

Use Docker Compose to Build Containers

Run from directory of your docker-compose.yml file.

Use Docker Compose to Start a Group of Containers

Use this command from directory of your docker-compose.yml file.

This will tell Docker to fetch the latest version of the container from the repo, and not use the local cache.

This can be problematic if you’re doing CI builds with Jenkins and pushing Docker images to another host, or using for CI testing. I was deploying a Spring Boot Web Application from Jekins, and found the docker container was not getting refreshed with the latest Spring Boot artifact.

Follow the Logs of Running Docker Containers With Docker Compose

Save a Running Docker Container as an Image

Follow the logs of one container running under Docker Compose

Introduction to Docker Course
Checkout my Free Introduction to Docker Course!

Dockerfile Hints for Spring Boot Developers

Add Oracle Java to an Image

For CentOS/ RHEL

Add / Run a Spring Boot Executable Jar to a Docker Image



About jt

    You May Also Like

    2 comments on “Docker Cheat Sheet for Spring Developers

    1. May 13, 2017 at 3:56 pm

      Typo in URL: “devlopers”. Possibly intentional, but if not you might want to alias from the typo so as not to mess up those Googling it (how I found it). Taking your course now… great stuff!

    2. June 10, 2017 at 9:44 am

      Thank you.


    Leave a Reply