Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Clean up dangling / orphan Docker volumes
# Because I keep forgetting this command...
DANGLING_VOLUMES=$(docker volume ls -qf dangling=true)
if [ -n "$DANGLING_VOLUMES" ]; then
echo $'\nRemoving volumes:'
docker volume rm $DANGLING_VOLUMES
echo $'\nNo dangling volumes to remove.'
echo $'\nDone!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment