Skip to content

Instantly share code, notes, and snippets.

@alexrios
Created May 20, 2016 13:36
Show Gist options
  • Save alexrios/11cc9d3f47a965b09bbb098a6c0d33d3 to your computer and use it in GitHub Desktop.
Save alexrios/11cc9d3f47a965b09bbb098a6c0d33d3 to your computer and use it in GitHub Desktop.
docker aliases
# ~/.bash_aliases
# Kill all running containers.
alias dockerkillall='docker kill $(docker ps -q)'
# Delete all stopped containers.
alias dockercleanc='printf "\n>>> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q)'
# Delete all untagged images.
alias dockercleani='printf "\n>>> Deleting untagged images\n\n" && docker rmi $(docker images -q -f dangling=true)'
# Delete all stopped containers and untagged images.
alias dockerclean='dockercleanc || true && dockercleani'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment