-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
support connection helpers (e.g. docker -H ssh://me@server) #889
Conversation
Looks pretty cool! |
Pinging some other people to take a look at this as well, particularly the docker cloud folks who'd worked on the "docker cloud proxy" thing. |
This looks backwards to me. We should need helper binaries(or a flag that invokes custom functionality) on the daemon side, not client so that we don't have a dependency on socat and "dind" doesn't need any dockerd specific functionality in client. Having a possibility to override the commands with configuration seems ok if there is some use-case but things like "dind://" seems more like "docker://" to me. It shouldn't be |
@tonistiigi Are you saying on the daemon to provide a way to setup custom listeners that we then serve the HTTP API over? |
@cpuguy83 No, daemon should provide a custom dialing command, eg. like |
Sorry I'm not sure I got what you meant. If we want to reuse helper binaries for other programs, I think we can remove the default |
No. I think the confusion comes because we use "helper binary" with very different meanings. I don't see big value in having custom dialer binaries in the client, we have dialers for unix, tcp, tls etc. so why not ssh and docker? This is a super helpful feature, why make it complicated to use? Otoh, I do find it valuable if we had a helper binary on daemon side so that we don't have a hard dependency on socat for this or leak a container to
A bigger problem is all the docker specific stuff currently in dind. If there was daemon side helper binary it would already know how to connect by default. |
OK, makes sense.
I think we should not enable @cpuguy83 WDYT? |
I disagree on |
Didn't we have a bunch of issues implementing ssh because of either:
|
@cpuguy83 And I think we decided to go with the conservative option(that everyone else uses). If this was reimplementing ssh I would definitely want it to be experimental or opt-in. |
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Codecov Report
@@ Coverage Diff @@
## master #889 +/- ##
==========================================
- Coverage 53.92% 53.88% -0.04%
==========================================
Files 262 262
Lines 16604 16621 +17
==========================================
+ Hits 8954 8957 +3
- Misses 7049 7061 +12
- Partials 601 603 +2 |
On second thought I think we should embed this socat-like functionality into
WDYT? |
We discussed this in the maintainers meeting with @thaJeztah @cpuguy83 We would like to implement SSH support similarly to the other tools that use this pattern, eg. systemd, and have it enabled by default. The cli should accept If calling the remote command fails there can be a fallback using socat and hardcoded default socket path. The other possible transports seem less critical atm. We can discuss supporting them after SSH is merged. Including the discussion, if some of them should be behind experimental flags or special config. |
ping @AkihiroSuda wdyt? |
+1, will update soon |
opened #1014 |
Signed-off-by: Akihiro Suda suda.akihiro@lab.ntt.co.jp
- What I did
Added support for "connection helpers", which supports custom connection protocols. e.g.
docker -H ssh://me@server
.This was originally suggested by @cpuguy83 moby/moby#31871 , as an alternative for my previous hard-coded
ssh://
proposal: moby/moby#33566- How I did it
cli/config/connhelper.GetConnectionHelper()
returnsnet.Conn
dialer for registered protocols likessh://
,dind://
...- How to verify it
Installation
Install
contrib/connhelper/docker-connection-{dind,ssh}
to$PATH
.Put the following config to
~/.docker/config.json
:Keys are protocol names, values for helper binary names. (
docker-connection-
prefix is omitted, as in cred helpers)use
ssh://
socat
to the hostdocker -H ssh://me@server run -it --rm busybox
use
dind://
docker run -d --name dind --privileged docker:edge-dind
docker -H dind://dind run -it --rm busybox
- Description for the changelog
support connection helpers (e.g. docker -H ssh://me@server)
- A picture of a cute animal (not mandatory but encouraged)
https://commons.wikimedia.org/wiki/File:Manchot_Ad%C3%A9lie_juv%C3%A9nile.jpg
Needs vendoring: moby/moby#36630