Skip to content

fix(down): conditionally emit progress events for dangling images - #14261

Open
hardikkaurani wants to merge 1 commit into
docker:mainfrom
hardikkaurani:fix/14219-down-dangling-output
Open

hardikkaurani wants to merge 1 commit into
docker:mainfrom
hardikkaurani:fix/14219-down-dangling-output

Conversation

@hardikkaurani

@hardikkaurani hardikkaurani commented Sep 25, 2026 •

Copy link
Copy Markdown

Summary

This PR fixes a UI bug where docker compose down --rmi local hangs 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 removeDanglingImages function triggers the api.Working event before filtering the images, failing to close the event if the list of targets is empty.

Changes

  • Pre-calculates the toRemove list in removeDanglingImages.
  • Accepts an onRemoving callback 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.

  • Different scope: This PR patches executable Go code in the image pruner, while docs: remove broken CONTRIBUTING.md link #14251 is a documentation-only fix for a Markdown file.
  • Different files: pkg/compose/image_pruner.go vs CONTRIBUTING.md.
  • No shared runtime behavior.

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 down and watch and does not alter container lifecycle management.

Original Template Items

Fixes #14219.

… 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
hardikkaurani requested review from a team as code owners September 25, 2026 08:11
@hardikkaurani
hardikkaurani requested review from glours and ndeloof and a lite review from Copilot September 25, 2026 08:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

[BUG] Unexpected output on already turned off service when running compose down

2 participants