-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker do not honor custom ssh port in ADD instruction while cloning git repositories #2468
Comments
Sorry for this back and forth movements. I've discovered that my work arroung doesn't work, so I've hesitated about source of error.
|
The underlying error is coming from BuildKit here; not sure if it indeed currently allows a custom port to be used, but let me transfer this ticket to the buildx issue tracker, which is the client used when running |
This should have been fixed in moby/buildkit#4142 (see moby/buildkit#4069 for more context). Not sure which version of buildkit is vendored in moby 26.1.2 though, so not sure if it includes that fix? |
moby v26.1.1 has buildkit v0.13.2 as a dependency. v0.13.2 has its code updated with changes that you've mentioned as far as I can tell. |
it seems I've found a fix. # syntax=docker/dockerfile:1
FROM ... I've manage to use ADD directive with custom port in ssh url. I'm wondering what is default value of syntax used anyway? |
I think the default would be the "frontend" code that's part of the BuildKit codebase that's used (so in this case, the v0.13.2 code https://github.com/moby/buildkit/tree/v0.13.2). That is, if you're using the default builder in the docker engine, but if you're using a custom builder ( |
Description
I'm self-hosting git server. It only allows cloning repos via ssh. I've change default ssh port.
I'm trying to use
ADD
instruction to add my repository to docker image, but it seems that docker doesn't honor other ssh port.Reproduce
Expected behavior
I expect docker to honor custom ports.
docker version
Client: Docker Engine - Community Version: 26.1.2 API version: 1.45 Go version: go1.21.10 Git commit: 211e74b Built: Wed May 8 13:59:59 2024 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 26.1.2 API version: 1.45 (minimum version 1.24) Go version: go1.21.10 Git commit: ef1912d Built: Wed May 8 13:59:59 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.31 GitCommit: e377cd56a71523140ca6ae87e30244719194a521 runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
Workaround: modifying ~/.ssh/config file with
works, but this requires to modify
ssh/config
on every machine that may need to build this imageThe text was updated successfully, but these errors were encountered: