fix(publish): accept short-form port mappings (fixes #13672) by Ijtihed · Pull Request #13849 · docker/compose · GitHub
Skip to content

fix(publish): accept short-form port mappings (fixes #13672)#13849

Open
Ijtihed wants to merge 1 commit into
docker:mainfrom
Ijtihed:fix-publish-short-form-ports-13672
Open

fix(publish): accept short-form port mappings (fixes #13672)#13849
Ijtihed wants to merge 1 commit into
docker:mainfrom
Ijtihed:fix-publish-short-form-ports-13672

Conversation

@Ijtihed

@Ijtihed Ijtihed commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What I did

docker compose publish failed with 'services[whoami].ports[0]' expected a map or struct, got "string" when a service used short-form port syntax like ${DASHBOARD_PORT:-3000}:3000.

composeFileAsByteReader used LoadWithContext which decodes ports into typed Go structs which rejects short-form string entries. Switching to LoadModelWithContext returns a raw map instead which in ths case avoids the struct decode

Related issue

Fixes #13672

@Ijtihed Ijtihed requested a review from a team as a code owner June 17, 2026 16:51
@Ijtihed Ijtihed requested review from glours and ndeloof June 17, 2026 16:51
@Mohataseem89

Copy link
Copy Markdown

Signed-off-by: Ijtihed Kilani <ijtihedk@gmail.com>
@Ijtihed Ijtihed force-pushed the fix-publish-short-form-ports-13672 branch from c8cdd16 to 523c51c Compare June 17, 2026 17:45
@Ijtihed

Ijtihed commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

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 rejects short-form port mapping

2 participants