The Wayback Machine - https://web.archive.org/web/20260409105841/https://github.com/docker/compose/pull/13669
Skip to content

fix: preserve ssh:// URL scheme when resolving Dockerfile path#13669

Merged
glours merged 1 commit intodocker:mainfrom
ssam18:fix/ssh-url-remote-context
Mar 27, 2026
Merged

fix: preserve ssh:// URL scheme when resolving Dockerfile path#13669
glours merged 1 commit intodocker:mainfrom
ssam18:fix/ssh-url-remote-context

Conversation

@ssam18
Copy link
Copy Markdown
Contributor

@ssam18 ssam18 commented Mar 25, 2026

When using an ssh:// URL as build context, filepath.Join was silently collapsing the double slash into a single one (ssh://ssh:/), making buildx unable to locate the Dockerfile. The fix returns the Dockerfile name as-is for any context containing a URL scheme (://), since buildx already knows how to resolve it relative to the remote context - the same way we already handle git:// and https:// contexts. Fix for the bug #13668.

@ssam18 ssam18 requested a review from a team as a code owner March 25, 2026 22:06
@ssam18 ssam18 requested review from glours and ndeloof March 25, 2026 22:06
filepath.Join cleans its arguments, collapsing the double slash in
ssh:// URLs to a single slash (ssh:/), corrupting the scheme before
it reaches buildx. Return the dockerfile as-is for any URL-schemed
context, matching the existing behaviour for git:// and https:// URLs.

Fixes the issue docker#13668

Signed-off-by: Samaresh Kumar Singh <ssam3003@gmail.com>
@ssam18 ssam18 force-pushed the fix/ssh-url-remote-context branch from 6672b7a to 0c5a3e3 Compare March 25, 2026 22:07
@glours
Copy link
Copy Markdown
Contributor

glours commented Mar 26, 2026

/review

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

@glours glours merged commit 612b8c5 into docker:main Mar 27, 2026
41 checks passed
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.

2 participants