Skip to content

Commit

Permalink
Follow changes to the default transport's settings in docker/docker/c…
Browse files Browse the repository at this point in the history
…lient

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Dec 9, 2024
1 parent d92481a commit 1e27965
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docker/daemon/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package daemon
import (
"net/http"
"path/filepath"
"time"

"github.com/containers/image/v5/types"
dockerclient "github.com/docker/docker/client"
Expand Down Expand Up @@ -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
Expand All @@ -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,
}
Expand Down

0 comments on commit 1e27965

Please sign in to comment.