Last active
April 18, 2016 19:48
-
-
Save lpenz/813a81c9a622a6fdd62d to your computer and use it in GitHub Desktop.
Docker garbage collector
This file contains hidden or 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 | |
set -x -e | |
: gc conteiners | |
docker ps --filter 'status=exited' -q | xargs -r docker rm | |
docker ps --filter 'status=created' -q | xargs -r docker rm | |
: gc images | |
docker images --filter "dangling=true" -q | xargs -r docker rmi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment