Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

17 Commits

Repository files navigation

docker-cheat-sheet

Quick reference guide for Docker commands - not at all exhaustive, just a cheat sheet.

Building/Running

taskcommand

Monitoring/Removing Images

taskcommand
list imagesdocker images
remove specific image(s)docker rmi <image_id> <image_id> ...
remove dangling imagesdocker image prune
remove all unused imagesdocker image prune --all
remove all imagesdocker rmi -f $(docker images -q)

Monitoring/Killing Containers

taskcommandnotes
see running containersdocker pslike ps in bash!
see most recently launched containerdocker ps -l-l for last
see all containersdocker ps -a-a for all
see hash of running containersdocker ps -q-q for hash
see hash of most recent containerdocker ps -qlmix -q and -l for hash of last
see hash of all containersdocker ps -aqditto for -a and -q
see running processesdocker top id containeruse id container
kill all running containersdocker kill $(docker ps -q)kill only stops running containers
kill most recent containerdocker kill $(docker ps -ql)
remove all exited containersdocker container prune
remove all containersdocker rm -f $(docker ps -qa)-f forces rm to kill and remove
remove old containersdocker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs docker rmremoves containers that are created weeks ago

About

Quick reference guide for Docker commands

Resources

Stars

3 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors