Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove dangling docker images and volumes
docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi
docker volume ls --quiet --filter=dangling=true | xargs --no-run-if-empty docker volume rm
@jcberthon

This comment has been minimized.

Copy link
Owner Author

jcberthon commented Sep 27, 2016

@pascalandy

This comment has been minimized.

Copy link

pascalandy commented Sep 11, 2017

@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
@pascalandy

This comment has been minimized.

Copy link

pascalandy commented Sep 11, 2017

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
You can’t perform that action at this time.