in docker/client.go [35:54]
func NewClient(host string, httpClient *http.Client, httpHeaders map[string]string) (*client.Client, error) {
log := logp.NewLogger("docker")
opts := []client.Opt{
client.WithHost(host),
client.WithHTTPClient(httpClient),
client.WithHTTPHeaders(httpHeaders),
}
version := os.Getenv("DOCKER_API_VERSION")
if version != "" {
log.Debugf("Docker client will use API version %v as set by the DOCKER_API_VERSION environment variable.", version)
opts = append(opts, client.WithVersion(version))
} else {
log.Debug("Docker client will negotiate the API version on the first request.")
opts = append(opts, client.WithAPIVersionNegotiation())
}
return client.NewClientWithOpts(opts...)
}