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

bake: forward default ssh agent for remote bake file #1711

Merged
merged 1 commit into from Apr 4, 2023

Conversation

jedevc
Copy link
Collaborator

@jedevc jedevc commented Apr 3, 2023

Not quite how, but at some point, ReadRemoteFiles stopped working with git remotes.

$ docker buildx bake "git@github.com:docker/buildx.git" --print binaries --progress=plain
#0 building with "container" instance using docker-container driver

#1 [internal] load git source git@github.com:docker/buildx.git
#1 ERROR: Unimplemented: unknown service moby.sshforward.v1.SSH
------
 > [internal] load git source git@github.com:docker/buildx.git:
------
ERROR: failed to find target binaries

When cloning git remotes, we need to attach the SSH agent service, so that this works:

docker buildx bake "git@github.com:docker/buildx.git" --print binaries --progress=plain
#0 building with "container" instance using docker-container driver

#1 [internal] load git source git@github.com:docker/buildx.git
#1 1.723 ref: refs/heads/master	HEAD
#1 1.849 6535f16aec98d4e94e3a5f6c9dbe736a0f407f7a	HEAD
#1 3.583 6535f16aec98d4e94e3a5f6c9dbe736a0f407f7a	refs/heads/master
#1 DONE 3.7s

#1 [internal] load git source git@github.com:docker/buildx.git
#1 CACHED
{
  "group": {
    "default": {
      "targets": [
        "binaries"
      ]
    }
  },
  "target": {
    "binaries": {
      "context": "git@github.com:docker/buildx.git",
      "dockerfile": "Dockerfile",
      "args": {
        "BUILDKIT_CONTEXT_KEEP_GIT_DIR": "1",
        "GO_VERSION": "1.20"
      },
      "target": "binaries",
      "platforms": [
        "local"
      ],
      "output": [
        "./bin/build"
      ]
    }
  }
}

Signed-off-by: Justin Chadwell <me@jedevc.com>
@jedevc jedevc requested a review from crazy-max April 3, 2023 09:53
@jedevc jedevc merged commit 5c21e80 into docker:master Apr 4, 2023
54 checks passed
@jedevc jedevc deleted the bake-remote-file-git branch April 4, 2023 10:50
@jedevc jedevc mentioned this pull request Apr 12, 2023
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.

None yet

2 participants