{{ message }}
Repository navigation
Conversation
Add oneOffFilter(false) to the Events subscription in monitor.Start() to exclude one-off containers created by `docker compose run` from triggering abort-on-container-exit. The initial container list (ContainerList) already excludes one-offs, but the event subscription didn't, causing one-off containers that exit to tear down the entire compose project. Fixes docker#14020
Contributor
ndeloof
approved these changes
Aug 10, 2026
Contributor
|
LGTM, but please signoff your commit (this is a legal requirement) |
ndeloof
enabled auto-merge (rebase)
August 10, 2026 16:00
Contributor
|
Hi @ndeloof |
Contributor
auto-merge was automatically disabled
August 12, 2026 13:50
Pull request was closed
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.

Description
Fixes #14020
Since 2.39.0, the new
monitor.gorefactoring introduced a regression wheredocker compose up --abort-on-container-exittears down the project when an unrelated one-off container created bydocker compose runexits.Root cause: The
ContainerListcall inmonitor.Start()correctly excludes one-off containers viaoneOffFilter(false), but the event subscription (Events()) does not. One-off containers carrycom.docker.compose.oneoff=Trueand pass through the service guard, causing the monitor to see their exit and abort the project.Fix: Add
oneOffFilter(false)to theEvents()filter args, matching theContainerListfilter. This is consistent withdocker/compose-cli#1987which established this exclusion deliberately.Verification
docker compose up --abort-on-container-exit main+docker compose run --rm main trueno longer triggers premature abortdocker compose up --abort-on-container-exitstill aborts when a declared service exits (verified independent of this fix)Related
docker compose runbrings down the cluster after one-off container finishes execution. docker-archive/compose-cli#1955, ignore one-off container events docker-archive/compose-cli#1987 (same fix for the old codebase)