diff --git a/perf/image-prune.sh b/perf/image-prune.sh new file mode 100644 index 0000000..10b8ffd --- /dev/null +++ b/perf/image-prune.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# perf/image-prune.sh — reclaim docker image slop on the Cloudron host. +# Removes UNUSED images only (not referenced by ANY container, running or +# stopped). NEVER touches volumes (app data!) or containers. Cloudron +# re-pulls an image if an app ever needs it again (costs a pull, no data +# loss). Founder-directed daily task 2026-09-03 [#758]. First run +# reclaimed 28.36GB. +# +# Run (from a checkout): +# VM_IP=my.knownelement.com VM_USER=root timeout 300 bash tests/remote.sh vm-file perf/image-prune.sh + +set -u + +echo "== before ==" +docker system df | grep -E "Images|Local Volumes" +df -h / | awk 'NR==2 { printf "root fs: %s used of %s (%s used)\n", $3, $2, $5 }' + +echo "== prune (unused images only; volumes/containers NEVER) ==" +docker image prune -af + +echo "== after ==" +docker system df | grep -E "Images|Local Volumes" +df -h / | awk 'NR==2 { printf "root fs: %s used of %s (%s used)\n", $3, $2, $5 }'