Created
April 22, 2016 12:01
-
-
Save didmar/1a40c8d7a04d0a2cabdb4a1272d49475 to your computer and use it in GitHub Desktop.
This file contains 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
## Shell command aliases for Docker | |
dockerip() { | |
# Get container ip | |
docker inspect --format '{{ .NetworkSettings.IPAddress }}' $1 | |
} | |
dockerkillall() { | |
printf "\n>>> Kill all running containers\n\n" && docker kill $(docker ps -q) | |
} | |
dockercleanc() { | |
printf "\n>>> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q) | |
} | |
dockercleani() { | |
printf "\n>>> Delete untagged images\n\n" && docker rmi $(docker images -q -f dangling=true) | |
} | |
dockerclean() { | |
printf "\n>>> Deleting stopped containers and untagged images\n\n" && dockercleanc || true && dockercleani | |
} | |
dockercleanall() { | |
printf "\n>>> Delete ALL images\n\n" && docker rmi $(docker images -q) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment