Skip to content

Instantly share code, notes, and snippets.

@stilliard
Created May 29, 2014 17:46
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 stilliard/85bc193428a2f01e06f1 to your computer and use it in GitHub Desktop.
Save stilliard/85bc193428a2f01e06f1 to your computer and use it in GitHub Desktop.
cleanup-docker
# Delete old docker containers
sudo docker rm `sudo docker ps --no-trunc -a -q`
# Delete old docker images
sudo docker rmi $(sudo docker images -a | grep -P '([A-z0-9_\-<>\/]+)\s+([A-z0-9_\-<>\/]+)\s+([A-z0-9_\-<>\/]+).*$' | awk '{print $3}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment