Last active
August 29, 2015 14:00
-
-
Save timruffles/bcf2c8bb4a9cfed325b1 to your computer and use it in GitHub Desktop.
clean up docker images - $2 = tags, $3 = image id
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
docker ps -a | grep Exit | awk '{print $1 }' | xargs docker rm |
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
# removes in reverse order, seems to avoid conflicts | |
docker images | awk '{ if($2 == "<none>") { print $3 } }' | tail -n +2 | tac | xargs docker rmi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment