From d0423ae22199fef1d1e9027c44ec7442ee094be0 Mon Sep 17 00:00:00 2001 From: reachableceo Date: Thu, 3 Sep 2026 12:06:48 -0500 Subject: [PATCH] feat(perf): daily image-prune script, first run reclaimed 28.36GB [#759] Unused images only (prune -a = not referenced by any container); volumes and containers NEVER touched. Wired into the daily 09:00 automation. Details: https://projects.knownelement.com/issues/759#note-1 --- perf/image-prune.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 perf/image-prune.sh 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 }'