diff --git a/docker-clean-all b/docker-clean-all index 4728187..20f6336 100755 --- a/docker-clean-all +++ b/docker-clean-all @@ -1,14 +1,21 @@ #!/bin/bash +# show current space. +echo "Current state:" +docker system df +echo +echo "Performing cleanup..." # remove exited containers: -docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v +docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v 1>/dev/null # remove unused images -docker image prune -a -f +docker image prune -a -f 1>/dev/null # remove unused volumes: -docker volume prune -a -f +docker volume prune -a -f 1>/dev/null # remove buildx cache -docker buildx prune -f +docker buildx prune -f 1>/dev/null # show results +echo +echo "After cleanup:" docker system df