From 1e27965ee5f0a99da3f47d690eb002c449300271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 9 Dec 2024 20:11:46 +0100 Subject: [PATCH] Follow changes to the default transport's settings in docker/docker/client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miloslav Trmač --- docker/daemon/client.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker/daemon/client.go b/docker/daemon/client.go index 64ccf6ae55..8cef9698f8 100644 --- a/docker/daemon/client.go +++ b/docker/daemon/client.go @@ -3,6 +3,7 @@ package daemon import ( "net/http" "path/filepath" + "time" "github.com/containers/image/v5/types" dockerclient "github.com/docker/docker/client" @@ -82,6 +83,11 @@ func tlsConfig(sys *types.SystemContext) (*http.Client, error) { Transport: &http.Transport{ Proxy: http.ProxyFromEnvironment, TLSClientConfig: tlsc, + // In general we want to follow docker/daemon/client.defaultHTTPClient , as long as it doesn’t affect compatibility. + // These idle connection limits really only apply to long-running clients, which is not our case here; + // we include the same values purely for symmetry. + MaxIdleConns: 6, + IdleConnTimeout: 30 * time.Second, }, CheckRedirect: dockerclient.CheckRedirect, }, nil @@ -92,6 +98,11 @@ func httpConfig() *http.Client { Transport: &http.Transport{ Proxy: http.ProxyFromEnvironment, TLSClientConfig: nil, + // In general we want to follow docker/daemon/client.defaultHTTPClient , as long as it doesn’t affect compatibility. + // These idle connection limits really only apply to long-running clients, which is not our case here; + // we include the same values purely for symmetry. + MaxIdleConns: 6, + IdleConnTimeout: 30 * time.Second, }, CheckRedirect: dockerclient.CheckRedirect, }