Forked from anildigital/gist:862675ec1b7bccabc311
Last active
September 11, 2017 02:59
-
-
Save jcberthon/8eb0caf2e6852cca51e3f5749fcece1a to your computer and use it in GitHub Desktop.
Remove dangling docker images and volumes
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
docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi |
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
docker volume ls --quiet --filter=dangling=true | xargs --no-run-if-empty docker volume rm |
@jcberthon Do you see a difference between
docker volume rm `docker volume ls -q -f dangling=true`
and your CMD ?
docker volume ls --quiet --filter=dangling=true | xargs --no-run-if-empty docker volume rm
For the images I use:
docker system df; \
docker system prune --all --force; \
docker system df; \
docker image ls;
Cheers!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks to @focusaurus for this hint: https://gist.github.com/anildigital/862675ec1b7bccabc311#gistcomment-1626611