Skip to content

Instantly share code, notes, and snippets.

@timruffles
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timruffles/bcf2c8bb4a9cfed325b1 to your computer and use it in GitHub Desktop.
Save timruffles/bcf2c8bb4a9cfed325b1 to your computer and use it in GitHub Desktop.
clean up docker images - $2 = tags, $3 = image id
docker ps -a | grep Exit | awk '{print $1 }' | xargs docker rm
# 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