Last active
December 20, 2018 09:11
-
-
Save salaros/2eca5083e9e4ad9315e100c649081268 to your computer and use it in GitHub Desktop.
Clean up Docker images, containers etc
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
# Just clean up incomplete images | |
[[ ! -z $(docker images --filter "dangling=true" -q --no-trunc) ]] && \ | |
docker rmi --force $(docker images --filter "dangling=true" -q --no-trunc) | |
#Remove unused containers | |
[[ ! -z $(docker ps -qa --no-trunc --filter "status=exited") ]] && \ | |
docker rm $(docker ps -qa --no-trunc --filter "status=exited") | |
# Remove all the images | |
docker system prune -a -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment