Created
January 14, 2015 21:20
-
-
Save cmheisel/6380025dd377472edf07 to your computer and use it in GitHub Desktop.
Docker cleanup commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kill exited containers and orphaned images, the kind, gentle way | |
alias dockercleancontainers="docker rm \$(docker ps -a --no-trunc | grep 'Exit' | awk '{print \$1}')" | |
alias dockercleanimages='docker rmi $(docker images -f dangling=true -q)' | |
alias dockerclean='dockercleancontainers && dockercleanimages' | |
# Kill all containers and all images with impunity. Dust off and nuke the site from orbit... only way to be sure | |
alias rmcont='docker rm $(docker ps -a -q)' | |
alias rmis='docker rmi -f $(docker images -a -q)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment