Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions image/docker/docker_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ func newDockerClient(sys *types.SystemContext, registry, reference string) (*doc
return nil, err
}

// If the non-host-specific trust bundle is given add it to the RootCAs pool
if sys.DockerAdditionalTrustedBundle != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sys can be nil.

tlsClientConfig.RootCAs.AppendCertsFromPEM([]byte(sys.DockerAdditionalTrustedBundle))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether the input wouldn’t be better as native Go Certificate, not forcing the client to serialize to text if the input is not originally text.

I don’t have a strong opinion at this point.

}

// Check if TLS verification shall be skipped (default=false) which can
// be specified in the sysregistriesv2 configuration.
skipVerify := false
Expand Down
2 changes: 2 additions & 0 deletions image/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@ type SystemContext struct {
// If not "", overrides the system’s default path for a directory containing host[:port] subdirectories with the same structure as DockerCertPath above.
// Ignored if DockerCertPath is non-empty.
DockerPerHostCertDirPath string
// If not "", a string containing PEM-encoded certificates to add to the trusted root CAs.
DockerAdditionalTrustedBundle string
// Allow contacting container registries over HTTP, or HTTPS with failed TLS verification. Note that this does not affect other TLS connections.
DockerInsecureSkipTLSVerify OptionalBool
// if nil, the library tries to parse ~/.docker/config.json to retrieve credentials
Expand Down
Loading