Created
November 2, 2016 18:34
-
-
Save petehalverson/46003b21dfba5d6b2af74c07c5c0b01d to your computer and use it in GitHub Desktop.
Docker aliases. Add to ~/.profile and restart your terminal
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
# Sync docker clock | |
alias dockerclock='docker run --rm --privileged alpine hwclock -s' | |
# Kill all running containers. | |
alias dockerkillall='docker kill $(docker ps -q)' | |
# stop all running containers | |
alias dockerstop='docker stop $(docker ps -a -q)' | |
# Delete all stopped containers. | |
alias dockercleanc='printf "\n>>> Deleting stopped containers\n\n" && docker rm -v $(docker ps -a -q -f status=exited)' | |
# Delete all untagged images. | |
alias dockercleani='printf "\n>>> Deleting untagged images\n\n" && docker rmi $(docker images -q -f dangling=true)' | |
# Delete all dangling volumes | |
alias dockercleanv='printf "\n>>> Deleting unused volumes\n\n" && docker volume rm $(docker volume ls -qf 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