fix(down): conditionally emit progress events for dangling images - #14261
Open
hardikkaurani wants to merge 1 commit into
Open
hardikkaurani wants to merge 1 commit into
hardikkaurani wants to merge 1 commit into
Conversation
… any Fixes docker#14219 by ensuring that dangling images removed output is not printed when there are no dangling images. Signed-off-by: Shubham Padkonde <shubhampadkonde21@gmail.com>
hardikkaurani
requested review from
glours and
ndeloof
and
a lite review from Copilot
September 25, 2026 08:11
This branch has not been deployed
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
This PR fixes a UI bug where
docker compose down --rmi localhangs on a 'Removing' progress event when there are no dangling images to remove. It makes the progress event conditional.Problem
The image pruner unconditionally emits a 'Removing' progress event before verifying if any dangling images actually exist, causing the CLI output to hang on an incomplete event.
Root Cause
The
removeDanglingImagesfunction triggers theapi.Workingevent before filtering the images, failing to close the event if the list of targets is empty.Changes
toRemovelist inremoveDanglingImages.onRemovingcallback to conditionally emit the progress event only if removals begin.Tests
Regression coverage is included for the affected behavior.
Why This Is Not a Duplicate
This PR addresses a different issue from #14251.
pkg/compose/image_pruner.govsCONTRIBUTING.md.Therefore, the two PRs address independent problems and this change does not supersede or duplicate #14251.
Scope
This change is limited to dangling image removal in
docker compose downandwatchand does not alter container lifecycle management.Original Template Items
Fixes #14219.