Created
January 16, 2020 16:25
-
-
Save particledecay/7ddf0fc47060fef00dce53d07bbff2a9 to your computer and use it in GitHub Desktop.
Clean up a system with docker on it regardless of version
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
[[ "$(echo "$(docker version -f '{{.Server.APIVersion}}')\n1.25" | sort -V | head -1)" == "1.25" ]] && (docker system df && docker system prune -a --volumes) || (docker rmi $(docker images --filter "dangling=true" -q --no-trunc) && docker volume rm $(docker volume ls -qf dangling=true) && docker rm $(docker ps -qa --no-trunc --filter "status=exited")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment