Repository navigation
fix(renovate): prune unused Docker images after recreating containers - #224
Merged
Merged
Conversation
renovate.py pulled a fresh image and recreated each app's container but never cleaned up the image it replaced. Over weeks of repeated runs across several apps, dangling images accumulated on the target host until the disk filled - observed in production on hawkeye.dupmachine.com, where a full root disk put every Postgres-backed app into a crash loop. deploy.py already runs this same cleanup after every deploy (`docker container prune -f && docker image prune -a -f`); renovate.py was just missing it. Add a prune_host() step, called once per host after all of that host's requested apps have been renovated, regardless of whether any of them actually changed - a previous run's now-superseded image is what needs cleaning up, not necessarily this run's own pull. Fixes #219 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Merged
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.
Summary
renovate.pyre-pulls and recreates each requested app's container, but never cleaned up the image layer it replaceddeploy.pyalready runs this exact cleanup after every deploy (docker container prune -f && docker image prune -a -f);renovate.pywas just missing the equivalentprune_host(host), called once per host after that host's requested apps are all renovated - unconditionally, since the image needing cleanup is the previous run's leftover, not necessarily this run's own pulldocker image pruneonly removes images with no referencing container, so an image still backing a running container is never touchedCloses #219
Test plan
.github/actions/renovate/tests- all 17 tests pass (addedPruneHostTest+ a dedicated "prunes each host once per invocation regardless of app count" case)ruff check .github/actions/renovate/passes🤖 Generated with Claude Code