Skip to content

Port SSH connhelper from github.com/docker/cli/cli/connhelper/ssh - #2843

Merged
tonistiigi merged 2 commits into
moby:masterfrom
fenollp:ssh-buildctl
May 4, 2022
Merged

Port SSH connhelper from github.com/docker/cli/cli/connhelper/ssh#2843
tonistiigi merged 2 commits into
moby:masterfrom
fenollp:ssh-buildctl

Conversation

@fenollp

@fenollp fenollp commented May 3, 2022

Copy link
Copy Markdown
Contributor

Fixes #2032

Note: second commit adds a new feature: ssh://.../path/to/socket to change the --addr that gets passed to buildctl. This is not allowed by Docker CLI's implementation so maybe should not be here.
I needed this as I run buildkitd rootless meaning socket is not under /run/buildkit root path. It's not needed per se as a workaround is:

#!/bin/sh -eu

exec $HOME/bin/buildctl --addr unix:///run/user/1000/buildkit/buildkitd.sock "$@"

I'm leaving this second commit in for discussion but I expect you'll want me to remove it.

fenollp added 2 commits May 3, 2022 20:38
…solve moby#2032

Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>

@AkihiroSuda AkihiroSuda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda

AkihiroSuda commented May 4, 2022

Copy link
Copy Markdown
Member

Note: second commit adds a new feature: ssh://.../path/to/socket to change the --addr that gets passed to buildctl. This is not allowed by Docker CLI's implementation so maybe should not be here.

Can we support this format in Docker CLI too? (For docker.sock, so slightly offtopic in BuildKit repo though)
Cc @thaJeztah

@tonistiigi
tonistiigi merged commit a7fa387 into moby:master May 4, 2022
@fenollp
fenollp deleted the ssh-buildctl branch May 4, 2022 16:14
@alexellis

Copy link
Copy Markdown

Quick question as @AkihiroSuda pointed me here.

I have seen that dockerd can be accessed via SSH instead of via a TCP connection, which means not having to configure mTLS.

For buildkit, whenever it's exposed over TCP it needs mTLS because RUN commands can also call the buildkit API. So would this change that, or is it just proxying from SSH to the socket, where the same configuration means RUN steps can access the API?

I'm looking into whether it makes sense to expose buildkit daemons for remote access (mTLS management required) - or dockerd itself (only seems to need SSH key management?)

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.

connhelper: support ssh://user@host

4 participants