Last active
August 29, 2015 14:08
-
-
Save daveslutzkin/ed4482ac372e129abfb7 to your computer and use it in GitHub Desktop.
Clean up docker containers and images
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
# Frees up a lot of disk space by removing almost everything from the docker cache. | |
# Get rid of all unnamed containers. | |
sudo docker ps -a | grep -v ":" | grep -v "ID" | awk '{ print $1 }' | sort | uniq | xargs sudo docker rm | |
# Get rid of all unnamed images. | |
sudo docker images | grep "^<none>" | awk '{ print $3 }' | xargs sudo docker rmi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment