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

Build fails with "unknown service moby.sshforward.v1.SSH" #2040

Closed
m-kratochvil opened this issue Mar 25, 2021 · 11 comments · Fixed by docker/cli#3050
Closed

Build fails with "unknown service moby.sshforward.v1.SSH" #2040

m-kratochvil opened this issue Mar 25, 2021 · 11 comments · Fixed by docker/cli#3050

Comments

@m-kratochvil
Copy link

m-kratochvil commented Mar 25, 2021

Environment:
Windows 10 host (Build 18363) with Docker Desktop (WSL2 backend) and Git for Windows. All working fine.

Issue:
Trying to build an image from URL context (private repo). Build fails with following error:

PS C:\Users\testuser> docker build -t testimage [email protected]:organization/testrepository.git
 => ERROR [internal] load git source [email protected]:organization/testrepository.git             0.0s
------
 > [internal] load git source [email protected]:organization/testrepository.git:
------
failed to solve with frontend dockerfile.v0: failed to read dockerfile: failed to load cache key: rpc error: code = Unimplemented desc = unknown service moby.sshforward.v1.SSH

I can run the build without any issues form other machines (Linux VMs local and cloud)
I can authenticate with GitHub and clone the above repository without any issues.

Thanks for any help, I could not find this condition described anywhere.. Let me know if more details are needed.

@tonistiigi
Copy link
Member

@alexcb

@pcaocm
Copy link

pcaocm commented Apr 12, 2021

Same issue, but on Mac

@alexcb
Copy link
Collaborator

alexcb commented Apr 12, 2021

Sorry I haven't had a chance to look into this; I don't have (easy) access to a windows machine, but I'll check to see if I can replicate it on a Mac.

@pcaocm
Copy link

pcaocm commented Apr 12, 2021

Sorry I haven't had a chance to look into this; I don't have (easy) access to a windows machine, but I'll check to see if I can replicate it on a Mac.

Thanks! It worked for me if I just do these:

export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0

alexcb added a commit to alexcb/cli-1 that referenced this issue Apr 13, 2021
…d line

- fixes moby/buildkit#2040 with a similar fix
which was done in docker/buildx#581

Signed-off-by: Alex Couture-Beil <[email protected]>
alexcb added a commit to alexcb/cli-1 that referenced this issue Apr 13, 2021
- this fixes moby/buildkit#2040 by enabling
ssh forwarding when a remote address is given on the command line, this
is a similar fix to docker/buildx#581

Signed-off-by: Alex Couture-Beil <[email protected]>
@acidprime
Copy link

Same issue but on Ubuntu 20.04,

Trying to build from a git URL

   aws-creds-server:
     build: '[email protected]:foo/bar.git'
docker-compose version 1.29.1, build unknown
docker-py version: 5.0.0
CPython version: 3.8.5
OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020

Had to install from pip as openssl compatibility doesn't work otherwise with the latest compose build.

failed to solve with frontend dockerfile.v0: failed to read dockerfile: failed to load cache key: rpc error: code = Unimplemented desc = unknown service moby.sshforward.v1.SSH
ERROR: Service 'aws-creds-server' failed to build : Build failed
make: *** [Makefile:13: container] Error 1

@alexcb
Copy link
Collaborator

alexcb commented Apr 16, 2021

@tonistiigi any chance you've been able to look at a potential fix in docker/cli#3050 ?

alexcb added a commit to alexcb/cli-1 that referenced this issue Apr 21, 2021
- this fixes moby/buildkit#2040 by enabling
ssh forwarding when a remote address is given on the command line, this
is a similar fix to docker/buildx#581

Signed-off-by: Alex Couture-Beil <[email protected]>
alexcb added a commit to alexcb/cli-1 that referenced this issue Apr 21, 2021
- this fixes moby/buildkit#2040 by enabling
ssh forwarding when a remote address is given on the command line, this
is a similar fix to docker/buildx#581

Signed-off-by: Alex Couture-Beil <[email protected]>
alexcb added a commit to alexcb/cli-1 that referenced this issue Apr 21, 2021
- this fixes moby/buildkit#2040 by enabling
ssh forwarding when a remote address is given on the command line, this
is a similar fix to docker/buildx#581

Signed-off-by: Alex Couture-Beil <[email protected]>
alexcb added a commit to alexcb/cli-1 that referenced this issue Aug 19, 2021
- this fixes moby/buildkit#2040 by enabling
ssh forwarding when a remote address is given on the command line, this
is a similar fix to docker/buildx#581

Signed-off-by: Alex Couture-Beil <[email protected]>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this issue Aug 19, 2021
- this fixes moby/buildkit#2040 by enabling
ssh forwarding when a remote address is given on the command line, this
is a similar fix to docker/buildx#581

Signed-off-by: Alex Couture-Beil <[email protected]>
Upstream-commit: af1bb80c3482d1395123af3037bb5ecf5feb5a7e
Component: cli
@creack
Copy link

creack commented Feb 24, 2023

This is still an issue with docker 23.0.0 / compose v2.15.1 on ubuntu 22.04 (linux/amd64)

Works well with the workaround provided here (DOCKER_BUILDKIT=0 COMPOSE_DOCKER_CLI_BUILD=0), but it is quite restrictive. Is there a better workaround by any chance? @thaJeztah

@crazy-max
Copy link
Member

@creack #2040 (comment) was about compose v1 that just shells out to docker build iirc, not compose v2 that uses buildx as a lib and therefore might miss the ssh specs implementation in the commands package. Can you try to build with docker buildx bake? More info about compose with bake: https://docs.docker.com/build/bake/compose-file/

@creack
Copy link

creack commented Feb 24, 2023

Quickly tried, but my project isn't compatible with compose v1.

Looked at the buildx bake docs... Didn't understand how to use it with git. I guess I'll just keep disabling buildkit for now. Would be good to see this issue re-opened though as it has not been addressed.

crazy-max pushed a commit to crazy-max/docker-cli that referenced this issue Mar 24, 2023
- this fixes moby/buildkit#2040 by enabling
ssh forwarding when a remote address is given on the command line, this
is a similar fix to docker/buildx#581

Signed-off-by: Alex Couture-Beil <[email protected]>
(cherry picked from commit af1bb80)
@EamonKeane
Copy link

For what it's worth, I got this again when running earthly 0.7.11 and latest docker engine. The same pipeline was working a few months ago so idk.

Client: Docker Engine - Community
Version: 24.0.4
API version: 1.43
Go version: go1.20.5
Git commit: 3713ee1
Built: Fri Jul 7 14:50:55 2023
OS/Arch: linux/amd64
Context: default

Server: Docker Engine - Community
Engine:
Version: 24.0.4
API version: 1.43 (minimum version 1.12)
Go version: go1.20.5
Git commit: 4ffc614
Built: Fri Jul 7 14:50:55 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.21
GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc:
Version: 1.1.7
GitCommit: v1.1.7-0-g860f061
docker-init:
Version: 0.19.0
GitCommit: de40ad0

@alexcb
Copy link
Collaborator

alexcb commented Jul 14, 2023

@EamonKeane please open an issue under https://github.com/earthly/earthly

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

Successfully merging a pull request may close this issue.

9 participants