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