Created
July 18, 2017 07:11
-
-
Save gourytch/b8e61f686959621c6e55070eed2e8de9 to your computer and use it in GitHub Desktop.
docker cleanup
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
#! /bin/bash | |
# remove all stopped containers | |
docker ps -a -q | xargs -r docker rm | |
#remove all unused volumes | |
docker volume ls -qf dangling=true | xargs -r docker volume rm | |
# remove all untagged images | |
docker images -q -f dangling=true | xargs -r docker rmi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment