Skip to content

fix(remove): delete the build images of the removed containers - #50

Merged
im-tyler merged 2 commits into
mainfrom
fix/remove-build-images
Oct 21, 2026
Merged

im-tyler merged 2 commits into
mainfrom
fix/remove-build-images

Conversation

@im-tyler

Copy link
Copy Markdown
Contributor

teploy remove left every <app>-build-<version> image behind: the deploy-time 72h image prune skips images that a kept (stopped) container still uses, and remove deleted those containers but not their images. Found during the D4 live test (a purged throwaway app left its build image).

  • Image names come from the app's own containers, not a name pattern, so another app's images (e.g. an app named x-build) are never matched.
  • docker rmi without force: an image still used by another container stays. Failures never fail the remove.
  • Pulled images are untouched.
  • --json reports removed_images (omitempty; remove JSON is not a contracts artifact).
  • Help text now also says the removal itself is recorded in the event history. Keeping that one record after --purge is intentional: it is the audit trail of who removed the app.

Also fixes a missing blank line in trigger_identity.go (gofmt) from #48.

Test: TestExecuteRemoveDeletesItsBuildImages.

🤖 Generated with Claude Code

im-tyler and others added 2 commits October 21, 2026 15:35
The deploy-time 72h prune skips images a kept container still uses, and
remove took the containers without their images, so a removed app's
<app>-build-* images stayed forever. Names come from the app's own
containers, removal is never forced, pulled images are untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Containers created by image ID report the ID in docker ps, so the name
check missed their build images (found live on infra-home).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@im-tyler
im-tyler merged commit 3dd03ca into main Oct 21, 2026
1 check passed
@im-tyler im-tyler mentioned this pull request Oct 21, 2026
@im-tyler
im-tyler deleted the fix/remove-build-images branch October 21, 2026 22:39
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