Skip to content

fix: prune dangling images immediately on each deploy#21

Merged
SPerekrestova merged 1 commit intomainfrom
fix/deploy-disk-cleanup
Mar 24, 2026
Merged

fix: prune dangling images immediately on each deploy#21
SPerekrestova merged 1 commit intomainfrom
fix/deploy-disk-cleanup

Conversation

@SPerekrestova
Copy link
Copy Markdown
Owner

Summary

  • Replace 7-day-filtered docker image prune with immediate docker image prune -f (dangling only, safe for named images)
  • Tighten builder cache prune from until=168h to until=24h to prevent multi-GB stale cache accumulation
  • Add post-build docker image prune -f to immediately reclaim the image replaced by each new build

Root Cause

Each deploy produces a new ~8.5 GB image and leaves the old one as <none>. With the 7-day filter, two stale builds (17 GB) accumulated alongside the current image, exhausting disk and causing no space left on device mid-build.

Test Plan

  • SSH into server and run docker image prune -f to clear the currently accumulated dangling images (~17 GB)
  • Merge this PR and verify the next deploy completes without no space left on device
  • Run docker system df post-deploy to confirm only the current image and nginx remain

🤖 Generated with Claude Code

Replace 168h-filtered prune commands with immediate cleanup.
Add post-build prune to clear the image replaced by each new build.
Prevents disk exhaustion from accumulating 8.5 GB dangling images.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@SPerekrestova SPerekrestova self-assigned this Mar 24, 2026
@SPerekrestova SPerekrestova merged commit b187917 into main Mar 24, 2026
3 checks passed
@SPerekrestova SPerekrestova deleted the fix/deploy-disk-cleanup branch March 24, 2026 19: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