Created
June 7, 2017 14:13
-
-
Save dmelo/78f60d7d1f7cdfe7a606f00cd8f57de8 to your computer and use it in GitHub Desktop.
Cleanup unused Docker images, containers and volumes
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 | |
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