Created
October 26, 2016 01:26
-
-
Save philipjkim/eba0e27e095b961b59383a0b881eb550 to your computer and use it in GitHub Desktop.
Docker clean-up
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
#!/bin/sh | |
# Reference: http://blog.yohanliyanage.com/2015/05/docker-clean-up-after-yourself/ | |
docker rm -v $(docker ps -a -q -f status=exited) | |
docker rmi $(docker images -f "dangling=true" -q) | |
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment