chore(deploy): prune dangling images after a successful auto-update - #176
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Jeder
:latest-Pull lässt das vorherigegatecontrol-Image als „dangling" zurück.update.shräumte das nie auf → der Docker-Host lief über Wochen voll. Incident 2026-06-23: 187 Images, Root-FS auf 100 %,docker pullscheiterte mitno space left on device, der*/5-Auto-Update hing still auf der alten Version.Fix
prune_images()-Helper ergänzt (docker image prune -f— nur 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.shwurde auf diesen Stand synchronisiert (sie war zusätzlich gedriftet — ihr fehlte derensure_guacd-Sidecar-Schritt). Backup unter/opt/gatecontrol/update.sh.bak-pre-prune-*.Verifikation
bash -ngrü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.