Uh oh!
There was an error while loading. Please reload this page.
support connection helpers (e.g. docker -H ssh://me@server) - #889
support connection helpers (e.g. docker -H ssh://me@server)#889AkihiroSuda wants to merge 1 commit into
Conversation
cpuguy83
commented
Feb 20, 2018
Looks pretty cool! |
cpuguy83
commented
Feb 20, 2018
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 |
cpuguy83
commented
Feb 20, 2018
@tonistiigi Are you saying on the daemon to provide a way to setup custom listeners that we then serve the HTTP API over? |
tonistiigi
commented
Feb 20, 2018
@cpuguy83 No, daemon should provide a custom dialing command, eg. like |
AkihiroSuda
commented
Feb 21, 2018
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 |
tonistiigi
commented
Feb 21, 2018
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. |
AkihiroSuda
commented
Feb 22, 2018
OK, makes sense.
I think we should not enable @cpuguy83 WDYT? |
tonistiigi
commented
Feb 22, 2018
I disagree on |
cpuguy83
commented
Feb 22, 2018
Didn't we have a bunch of issues implementing ssh because of either:
|
tonistiigi
commented
Feb 22, 2018
@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 |
AkihiroSuda
commented
Mar 19, 2018
On second thought I think we should embed this socat-like functionality into
WDYT? |
tonistiigi
commented
Apr 5, 2018
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. |
thaJeztah
commented
Apr 12, 2018
ping @AkihiroSuda wdyt? |
AkihiroSuda
commented
Apr 13, 2018
+1, will update soon |
AkihiroSuda
commented
Apr 20, 2018
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 @cpuguy83moby/moby#31871 , as an alternative for my previous hard-coded
ssh://proposal: moby/moby#33566- How I did it
cli/config/connhelper.GetConnectionHelper()returnsnet.Conndialer 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://socatto the hostdocker -H ssh://me@server run -it --rm busyboxuse
dind://docker run -d --name dind --privileged docker:edge-dinddocker -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