Skip to content

chore(deploy): prune dangling images after a successful auto-update - #176

Merged
CallMeTechie merged 1 commit into
masterfrom
chore/update-sh-prune-images
Jun 24, 2026
Merged

CallMeTechie merged 1 commit into
masterfrom
chore/update-sh-prune-images

Conversation

@CallMeTechie

Copy link
Copy Markdown
Owner

Problem

Jeder :latest-Pull lässt das vorherige gatecontrol-Image als „dangling" zurück. update.sh räumte das nie auf → der Docker-Host lief über Wochen voll. Incident 2026-06-23: 187 Images, Root-FS auf 100 %, docker pull scheiterte mit no space left on device, der */5-Auto-Update hing still auf der alten Version.

Fix

prune_images()-Helper ergänzt (docker image prune -fnur Dangling, getaggte/benutzte Images bleiben unangetastet) und nach erfolgreichem Recreate in beiden Pfaden (manual + auto) aufgerufen.

Angewendet auf das ausgelieferte Template (src/services/systemSetup/templates/update.sh) + die Repo-Kopie. Die Live-/opt/gatecontrol/update.sh wurde auf diesen Stand synchronisiert (sie war zusätzlich gedriftet — ihr fehlte der ensure_guacd-Sidecar-Schritt). Backup unter /opt/gatecontrol/update.sh.bak-pre-prune-*.

Verifikation

bash -n grün; Live-Lauf auf dem Host: „auto: already up to date", exit 0, keine Fehler. Akut wurden bereits ~23 GB freigegeben, Container läuft auf v1.93.6.

Each :latest pull leaves the previous gatecontrol image dangling. update.sh never
removed them, so the Docker host filled up over time — incident 2026-06-23: 187
images, root fs at 100%, 'docker pull' failed with 'no space left on device', and
the */5 auto-update silently stalled on the old version.

Add a prune_images() helper (docker image prune -f — dangling only, tagged/in-use
images are never touched) and call it after a successful recreate in both the
manual and auto paths. Applied to the served template and the repo copy; the live
/opt/gatecontrol/update.sh was synced to this version too (it had also drifted —
it was missing the ensure_guacd sidecar step).
@CallMeTechie
CallMeTechie merged commit 52aeb93 into master Jun 24, 2026
8 checks passed
@CallMeTechie
CallMeTechie deleted the chore/update-sh-prune-images branch June 25, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant