From 29734b91033dbaba0497fa3871934aa44cc8ae2f Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 30 Jan 2020 16:20:52 +0100 Subject: [PATCH 1/2] Revert "docs: document ssh multiplexing env" This reverts commit 4ecbef46602f62c52b8e3a36401265dc87fab940. Signed-off-by: Sebastiaan van Stijn --- docs/reference/commandline/cli.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/reference/commandline/cli.md b/docs/reference/commandline/cli.md index ce8d554c0c..b5aef34692 100644 --- a/docs/reference/commandline/cli.md +++ b/docs/reference/commandline/cli.md @@ -86,8 +86,6 @@ by the `docker` command line: * `DOCKER_TMPDIR` Location for temporary Docker files. * `DOCKER_CONTEXT` Specify the context to use (overrides DOCKER_HOST env var and default context set with "docker context use") * `DOCKER_DEFAULT_PLATFORM` Specify the default platform for the commands that take the `--platform` flag. -* `DOCKER_SSH_NO_MUX` If set will turn off SSH multiplexing when connecting to daemon through SSH. -* `DOCKER_SSH_MUX_PERSIST` Set a duration for keeping SSH multiplexing socket alive between commands (e.g `60s`). Because Docker is developed using Go, you can also use any environment variables used by the Go runtime. In particular, you may find these useful: From 2a08462debc2587c94a62e8c9c76eaa49c243466 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 30 Jan 2020 16:21:04 +0100 Subject: [PATCH 2/2] Revert "connhelper: add ssh multiplexing" This reverts commit c04dd6e244a95ef00fe37c1cc1caa664acd14863. Signed-off-by: Sebastiaan van Stijn --- cli/connhelper/connhelper.go | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/cli/connhelper/connhelper.go b/cli/connhelper/connhelper.go index 58f0c7a1d6..da3640db1a 100644 --- a/cli/connhelper/connhelper.go +++ b/cli/connhelper/connhelper.go @@ -5,10 +5,7 @@ import ( "context" "net" "net/url" - "os" - "strconv" - "github.com/docker/cli/cli/config" "github.com/docker/cli/cli/connhelper/commandconn" "github.com/docker/cli/cli/connhelper/ssh" "github.com/pkg/errors" @@ -37,7 +34,7 @@ func GetConnectionHelper(daemonURL string) (*ConnectionHelper, error) { } return &ConnectionHelper{ Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) { - return commandconn.New(ctx, "ssh", append(multiplexingArgs(), append(sp.Args(), []string{"--", "docker", "system", "dial-stdio"}...)...)...) + return commandconn.New(ctx, "ssh", append(sp.Args(), []string{"--", "docker", "system", "dial-stdio"}...)...) }, Host: "http://docker", }, nil @@ -56,19 +53,3 @@ func GetCommandConnectionHelper(cmd string, flags ...string) (*ConnectionHelper, Host: "http://docker", }, nil } - -func multiplexingArgs() []string { - if v := os.Getenv("DOCKER_SSH_NO_MUX"); v != "" { - if b, err := strconv.ParseBool(v); err == nil && b { - return nil - } - } - if err := os.MkdirAll(config.Dir(), 0700); err != nil { - return nil - } - args := []string{"-o", "ControlMaster=auto", "-o", "ControlPath=" + config.Dir() + "/%r@%h:%p"} - if v := os.Getenv("DOCKER_SSH_MUX_PERSIST"); v != "" { - args = append(args, "-o", "ControlPersist="+v) - } - return args -}