Skip to content

fix(compose): improve image pruning during uninstall#133

Closed
mike-sul wants to merge 3 commits into
mainfrom
fix/uninstall-images-correctly
Closed

fix(compose): improve image pruning during uninstall#133
mike-sul wants to merge 3 commits into
mainfrom
fix/uninstall-images-correctly

Conversation

@mike-sul
Copy link
Copy Markdown
Collaborator

Either remove all unused images (when the "dangling" filter is false), or remove only images referenced by apps being uninstalled, unless they are still used by one or more containers.

Update the integration test to verify that no images remain after uninstall with pruning enabled.

Either remove all unused images (when the "dangling" filter is false),
or remove only images referenced by apps being uninstalled, unless they
are still used by one or more containers.

Update the integration test to verify that no images remain after
uninstall with pruning enabled.

Signed-off-by: Mike Sul <mike.sul@foundries.io>
Remove the unused KeepApps option from complete pruning.

complete already determines obsolete apps by comparing currently
installed apps with the update target set, so an explicit keep list is
redundant and no longer needed.

Simplify CompleteOpts, CompleteWithPruning(), and pruning logic
accordingly.

Signed-off-by: Mike Sul <mike.sul@foundries.io>
Extend CompleteWithPruning() with an optional flag to prune all unused
images, not only those associated with removed apps.

When obsolete apps are removed, pass the option through to uninstall
image pruning. If no apps need removal, still prune unused Docker images
directly.

This allows cleanup of stale images even when the update does not remove
any installed apps.

Signed-off-by: Mike Sul <mike.sul@foundries.io>
@mike-sul mike-sul force-pushed the fix/uninstall-images-correctly branch from b6b9d32 to f95ef6e Compare April 21, 2026 10:37
@mike-sul mike-sul closed this Apr 24, 2026
@mike-sul mike-sul deleted the fix/uninstall-images-correctly branch April 24, 2026 08:16
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