Skip to content

fix(config): resolve service environment when computing --hash - #14002

Open
glours wants to merge 1 commit into
docker:mainfrom
glours:config-hash-env-file
Open

fix(config): resolve service environment when computing --hash#14002
glours wants to merge 1 commit into
docker:mainfrom
glours:config-hash-env-file

Conversation

@glours

@glours glours commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What I did
Containers are created from a project whose service environment is resolved (env_file merged into environment), but since v2.22.0 config --hash skipped that resolution, so hashes diverged from the com.docker.compose.config-hash label for services using env_file.

Resolve the environment of the hashed services only, so a broken env_file or platforms on an unrelated service still doesn't prevent hashing, and honor --no-env-resolution as an escape hatch.

Related issue
Fixes #14001

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

Containers are created from a project whose service environment is
resolved (env_file merged into environment), but since v2.22.0 `config
--hash` skipped that resolution, so hashes diverged from the
com.docker.compose.config-hash label for services using env_file.

Resolve the environment of the hashed services only, so a broken
env_file or platforms on an unrelated service still doesn't prevent
hashing, and honor --no-env-resolution as an escape hatch.

Fixes docker#14001

Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
@glours
glours requested review from a team as code owners August 5, 2026 08:38
@glours
glours requested a review from ndeloof August 5, 2026 08:38
@glours glours self-assigned this Aug 5, 2026
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/compose/config.go 66.66% 1 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@glours
glours requested a review from docker-agent August 5, 2026 10:17
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] config --hash does not match container config-hash for services using env_file

1 participant