Skip to content

Commit 7ccf017

Browse files
committed
always pass 'nil' platform to ContainerCreate
Passing nil to ContainerCreate means that the client library will ignore this arg and not pass it in the list of arguments it submits to the docker API. see https://github.com/moby/moby/blob/4c0d75bc8e8311407040ae7c930f5a2c2c9c03aa/client/container_create.go#L49 We don't want to pass the platform arg because we are not using it and this is the simplest way to ensure continued support of older docker versions.
1 parent 007e6c0 commit 7ccf017

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

agent/dockerclient/dockerapi/docker_client.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ import (
5353
"github.com/docker/docker/api/types/filters"
5454
"github.com/docker/docker/api/types/network"
5555
"github.com/docker/docker/api/types/volume"
56-
v1 "github.com/opencontainers/image-spec/specs-go/v1"
5756
)
5857

5958
const (
@@ -575,7 +574,7 @@ func (dg *dockerGoClient) createContainer(ctx context.Context,
575574
return DockerContainerMetadata{Error: CannotGetDockerClientError{version: dg.version, err: err}}
576575
}
577576

578-
dockerContainer, err := client.ContainerCreate(ctx, config, hostConfig, &network.NetworkingConfig{}, &v1.Platform{}, name)
577+
dockerContainer, err := client.ContainerCreate(ctx, config, hostConfig, &network.NetworkingConfig{}, nil, name)
579578
if err != nil {
580579
return DockerContainerMetadata{Error: CannotCreateContainerError{err}}
581580
}

0 commit comments

Comments
 (0)