diff --git a/cli/command/cli.go b/cli/command/cli.go index e9b274f5ec..4ac881f2dc 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -2,9 +2,11 @@ package command import ( "io" + "net" "net/http" "os" "runtime" + "time" "github.com/docker/cli/cli" cliconfig "github.com/docker/cli/cli/config" @@ -214,6 +216,10 @@ func newHTTPClient(host string, tlsOptions *tlsconfig.Options) (*http.Client, er } tr := &http.Transport{ TLSClientConfig: config, + DialContext: (&net.Dialer{ + KeepAlive: 30 * time.Second, + Timeout: 30 * time.Second, + }).DialContext, } proto, addr, _, err := client.ParseHost(host) if err != nil {