"path/filepath"
"strings"
+ "git.arvados.org/arvados.git/lib/crunchrun"
"git.arvados.org/arvados.git/sdk/go/ctxlog"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
}
func dockerRm(ctx context.Context, name string) error {
- cli, err := client.NewClient(client.DefaultDockerHost, "1.21", nil, nil)
+ cli, err := client.NewClient(client.DefaultDockerHost, crunchrun.DockerAPIVersion, nil, nil)
if err != nil {
return err
}
"path/filepath"
"strings"
+ "git.arvados.org/arvados.git/lib/crunchrun"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
)
}
func dockerImageExists(ctx context.Context, name string) (bool, error) {
- cli, err := client.NewClient(client.DefaultDockerHost, "1.21", nil, nil)
+ cli, err := client.NewClient(client.DefaultDockerHost, crunchrun.DockerAPIVersion, nil, nil)
if err != nil {
return false, err
}
// Docker daemon won't let you set a limit less than ~10 MiB
const minDockerRAM = int64(16 * 1024 * 1024)
+// DockerAPIVersion is the API version we use to communicate with the
+// docker service. The oldest OS we support is Ubuntu 18.04 (bionic)
+// which originally shipped docker 1.17.12 / API 1.35 so there is no
+// reason to use an older API version. See
+// https://dev.arvados.org/issues/15370#note-38 and
+// https://docs.docker.com/engine/api/.
+const DockerAPIVersion = "1.35"
+
type dockerExecutor struct {
containerUUID string
logf func(string, ...interface{})
func newDockerExecutor(containerUUID string, logf func(string, ...interface{}), watchdogInterval time.Duration) (*dockerExecutor, error) {
// API version 1.21 corresponds to Docker 1.9, which is
// currently the minimum version we want to support.
- client, err := dockerclient.NewClient(dockerclient.DefaultDockerHost, "1.21", nil, nil)
+ client, err := dockerclient.NewClient(dockerclient.DefaultDockerHost, DockerAPIVersion, nil, nil)
if watchdogInterval < 1 {
watchdogInterval = time.Minute
}