Skip to content

fix: initialize and pass envFiles map in processExtends#13678

Merged
glours merged 1 commit intodocker:mainfrom
Mohamed-Moumni:main
Mar 27, 2026
Merged

fix: initialize and pass envFiles map in processExtends#13678
glours merged 1 commit intodocker:mainfrom
Mohamed-Moumni:main

Conversation

@Mohamed-Moumni
Copy link
Copy Markdown
Contributor

Title: fix: initialize envFiles map in processExtends to handle env_file during publish

Description:

What I did

Initialize envFiles as an empty map in processExtends and pass it to processFile instead of nil.

Why

When running docker compose publish on a project that uses extends with services referencing env_file, processFile attempts to assign entries into the envFiles map. Since nil was passed, this caused a panic:

panic: assignment to entry in nil map
goroutine 1 [running]:
github.com/docker/compose/v5/pkg/compose.processFile(...)
    github.com/docker/compose/v5/pkg/compose/publish.go:255 +0x651

Fixes #13671

Signed-off-by: Mohamed-Moumni <mohamedmoumni593@gmail.com>
@Mohamed-Moumni Mohamed-Moumni requested a review from a team as a code owner March 26, 2026 11:54
Copy link
Copy Markdown
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution 🙏

@glours glours enabled auto-merge (rebase) March 27, 2026 14:52
@glours glours merged commit e742d09 into docker:main Mar 27, 2026
43 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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] docker compose publish panics with nil map when using extends

2 participants