drop the platform argument to avoid being compatible ONLY with API 1.41 (#582)

This commit is contained in:
Thibault "bui" Koechlin 2021-01-18 15:25:07 +01:00 committed by GitHub
parent 81e7db71ed
commit 25562e9575
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,6 @@ import (
"github.com/docker/docker/api/types/mount"
"github.com/docker/docker/client"
"github.com/docker/go-connections/nat"
v1 "github.com/opencontainers/image-spec/specs-go/v1"
log "github.com/sirupsen/logrus"
)
@ -100,13 +99,8 @@ func (c *Container) Create() error {
return fmt.Errorf("OS '%s' is not supported", os)
}
arch := runtime.GOARCH
platform := &v1.Platform{
Architecture: arch,
OS: os,
}
log.Infof("creating container '%s'", c.Name)
resp, err := c.CLI.ContainerCreate(ctx, dockerConfig, hostConfig, nil, platform, c.Name)
resp, err := c.CLI.ContainerCreate(ctx, dockerConfig, hostConfig, nil, nil, c.Name)
if err != nil {
return fmt.Errorf("failed to create container : %s", err)
}