Skip to content

Instantly share code, notes, and snippets.

@jeremyvdw
Created July 1, 2014 11:27
Show Gist options
  • Save jeremyvdw/91baaadb7028d5612538 to your computer and use it in GitHub Desktop.
Save jeremyvdw/91baaadb7028d5612538 to your computer and use it in GitHub Desktop.
Docker: cleans exited containers and unused images
# delete all non-running container
docker ps -a | grep 'Exit' | awk '{print $1}' | xargs docker rm
# delete unused images
docker images | grep '<none>' | awk '{print $3}' | xargs docker rmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment