Skip to content

HTTP client transport replacement makes docker unreachable with the docker client. #705

@denismakogon

Description

@denismakogon

If i would do something like:

client, err := docker.NewClientFromEnv()

and then:

	t := &http.Transport{
		Dial: (&net.Dialer{
			Timeout:   10 * time.Second,
			KeepAlive: 1 * time.Minute,
		}).Dial,
		TLSClientConfig: &tls.Config{
			ClientSessionCache: tls.NewLRUClientSessionCache(8192),
		},
		TLSHandshakeTimeout:   10 * time.Second,
		MaxIdleConnsPerHost:   512,
		Proxy:                 http.ProxyFromEnvironment,
		MaxIdleConns:          512,
		IdleConnTimeout:       90 * time.Second,
		ExpectContinueTimeout: 1 * time.Second,
	}
       client.HTTPClient = &http.Client{Transport: t}

would lead to the following error:

Get http://unix.sock/_ping: dial tcp: lookup unix.sock: no such host

So, there has to be the way to replace HTTP client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions