Last active
August 5, 2016 15:53
-
-
Save ponelat/0db79e98a8ace9a85bf74aa018e063b3 to your computer and use it in GitHub Desktop.
docker clean
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/sh | |
# Run with... | |
# Use the raw github link ( there will be a button on this page) | |
# curl -sL https://gist.githubusercontent.com/.... | sudo bash | |
echo ==================================================== | |
docker rm -v $(docker ps -a -q -f status=exited) || echo 'No containers to clean up with status=exited' | |
echo ==================================================== | |
docker rmi $(docker images -f "dangling=true" -q) || echo 'No images to clean up with dangling=true' | |
echo ==================================================== | |
docker volume rm $(docker volume ls -qf dangling=true) || echo "No dangling volumes to clean" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment