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
This commit is contained in:
2026-09-03 12:06:48 -05:00
parent 09567e9165
commit d0423ae221
+23
View File
@@ -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 }'