Repository navigation
Conversation
projectOrName only loaded the Compose model when -f was passed or when no project name was given. With -p and COMPOSE_FILE, the model was skipped, so commands like stop received no project and rebuilt it from container labels, which don't carry pre_stop hooks: the hooks were silently not run. COMPOSE_FILE is the environment equivalent of -f, so treat it the same way when deciding to load the model. Fixes docker#14535 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
…ilure When the Compose model can't be loaded, projectOrName falls back to the label-driven project and used COMPOSE_PROJECT_NAME while ignoring an explicit -p. With -p x and COMPOSE_PROJECT_NAME=y, commands such as ps, down or rm then targeted project y instead of x. Use -p first and COMPOSE_PROJECT_NAME only when -p is empty, matching the usual precedence. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
glours
force-pushed
the
fix-14535-compose-file-with-project-name
branch
from
November 20, 2026 15:03
7d54ab6 to
e5a989e
Compare
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟡 NEEDS ATTENTION
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Fixes #14535
COMPOSE_FILEis now handled like-fwhen-pis set: the model is loaded, sostoprunspre_stophooks instead of rebuilding a label-only project that doesn't carry them.-pnow takes precedence overCOMPOSE_PROJECT_NAMEin the label-driven fallback (previously the env var won, and commands targeted the wrong project).