Last active
October 23, 2016 17:59
-
-
Save greyltc/ea2b0fbc5e815af55768 to your computer and use it in GitHub Desktop.
cleans up docker images/containers
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
#!/usr/bin/env bash | |
# docker cleanup (if you're not careful, docker loves to eat disk space) | |
# bash <(curl -L https://gist.github.com/greyltc/ea2b0fbc5e815af55768/raw) | |
echo "Cleaning up unneeded docker images." | |
docker stop $(docker ps -a -q) || echo "No container to stop" | |
docker rm $(docker ps -a -q) || echo "No container to remove" | |
docker rmi $(docker images -f "dangling=true" -q) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment