Last active
December 20, 2016 13:33
-
-
Save pi0/9af0176b7774e9bd571e8969b9a16f67 to your computer and use it in GitHub Desktop.
Docker Safe Cleanup Scripts
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
# Print docker usages | |
# Cleanup containers | |
for i in ` docker ps -a | grep -v -e "data" -e "volume" -e "Up" | awk '{ print $1; }'`; do docker rm $i ; done | |
# Cleanup images | |
for i in `docker images -a | grep "<none>" | awk '{ print $3; }'`; do docker rmi -f $i ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment