Skip to content
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

labs: ADD using git@ should not show git:// as protocol in output/error #3585

Open
thaJeztah opened this issue Feb 4, 2023 · 3 comments
Open

Comments

@thaJeztah
Copy link
Member

When using ADD <git reference> and using git@ for the git repository, the output shows git:// as protocol used. To my understanding we don't use the git:// protocol (https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_the_git_protocol) in this case, so we should change the presentation to make this less ambiguous.

docker build -t foo -<<'EOF'
# syntax=docker/dockerfile:1-labs
FROM alpine
ADD [email protected]:moby/buildkit.git /bar
EOF
[+] Building 2.5s (9/10)
 => [internal] load build definition from Dockerfile                                                                            0.0s
 => => transferring dockerfile: 125B                                                                                            0.0s
 => [internal] load .dockerignore                                                                                               0.0s
 => => transferring context: 2B                                                                                                 0.0s
 => resolve image config for docker.io/docker/dockerfile:1-labs                                                                 1.2s
 => docker-image://docker.io/docker/dockerfile:1-labs@sha256:033d4afc7bdc581d28bc98b35598fffb1ead5a0dbe9ef2e00546e559b650e8da   0.8s
 => => resolve docker.io/docker/dockerfile:1-labs@sha256:033d4afc7bdc581d28bc98b35598fffb1ead5a0dbe9ef2e00546e559b650e8da       0.0s
 => => sha256:e2d8189d2e09965ae5a6258b26f6aa2198f6c22acf0f5f649ab07933d9fc0de6 2.96kB / 2.96kB                                  0.0s
 => => sha256:6feb11935ba445d8f9673f63bfe2b72a7d4dae6a732cd117b1a858075b89282d 11.55MB / 11.55MB                                0.2s
 => => sha256:033d4afc7bdc581d28bc98b35598fffb1ead5a0dbe9ef2e00546e559b650e8da 7.65kB / 7.65kB                                  0.0s
 => => sha256:12a4a575cfd6aef7e7c65cdb267d2ce0d047f88539107f42f51acb3861656c9a 482B / 482B                                      0.0s
 => => extracting sha256:6feb11935ba445d8f9673f63bfe2b72a7d4dae6a732cd117b1a858075b89282d                                       0.5s
 => [internal] load .dockerignore                                                                                               0.0s
 => [internal] load build definition from Dockerfile                                                                            0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                                                                0.0s
 => ERROR git://github.com/moby/buildkit.git                                                                                    0.0s
 => [1/2] FROM docker.io/library/alpine                                                                                         0.0s
------
 > git://github.com/moby/buildkit.git:
#10 0.036 Initialized empty Git repository in /var/lib/docker/overlay2/wwummvmowx7pewk3stah6bhdy/diff/
------
failed to load cache key: rpc error: code = Unimplemented desc = unknown service moby.sshforward.v1.SSH
 => ERROR git://github.com/moby/buildkit.git                                                                                    0.0s
@thaJeztah
Copy link
Member Author

I'm also wondering if we can (should) somehow switch protocol when checking out a public repository and no --ssh flag is provided (not sure what the best approach is there).

@thaJeztah
Copy link
Member Author

/cc @AkihiroSuda

@AkihiroSuda
Copy link
Member

git:// here refers to the llb source type, not proto.
But I agree the current output is very confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants