Last active
March 24, 2016 16:48
-
-
Save viebig/3eb40fcb984d96bb61f1 to your computer and use it in GitHub Desktop.
Clean docker, free some disk space
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
# Make sure that exited containers are deleted | |
docker rm -v $(docker ps -a -q -f status=exited) | |
# Remove unwanted ‘dangling’ images. | |
docker rmi $(docker images -f "dangling=true" -q) | |
# Unwanted volumes | |
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes | |
# or just | |
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