Created
July 1, 2014 11:27
-
-
Save jeremyvdw/91baaadb7028d5612538 to your computer and use it in GitHub Desktop.
Docker: cleans exited containers and unused 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
# 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