/docker-cheat-sheet

my personal docker cheat sheet

Apache License 2.0Apache-2.0

My personal Docker cheat sheet

Docker Engine is plenty of commands. There are more detailed cheat sheets out there (e.g., this one); here I just try to put together some useful commands/tips I usually need.

List running containers

docker ps

(appending -a lists all)

Commit current version of the container

docker commit CONTAINER_ID TAG

Stop a container

docker stop CONTAINER_ID

Remove a container

docker rm CONTAINER_ID

Remove all containers

docker rm $(docker ps -a -q)

List images

docker images --tree

Remove an image

docker rmi IMAGE_ID

Remove non-labelled images

docker rmi $(docker images -q --filter "dangling=true")

Remove all images

docker rmi $(docker images -q)