diff --git a/client.go b/client.go index 56431de0b2..ee3447ede1 100644 --- a/client.go +++ b/client.go @@ -149,6 +149,8 @@ func WithRegistryMirrors(registryMirrors map[string]string) ClientOption { } } +const DockerAPIVersion = "1.38" + // NewClient allocates and returns a Client configured with the specified options. func NewClient(opts ...ClientOption) (*Client, error) { var client Client @@ -165,7 +167,7 @@ func NewClient(opts ...ClientOption) (*Client, error) { var err error client.docker, err = dockerClient.NewClientWithOpts( dockerClient.FromEnv, - dockerClient.WithVersion("1.38"), + dockerClient.WithVersion(DockerAPIVersion), ) if err != nil { return nil, errors.Wrap(err, "creating docker client") diff --git a/cmd/docker_init.go b/cmd/docker_init.go index 0c9db007ca..2a2f7d41a9 100644 --- a/cmd/docker_init.go +++ b/cmd/docker_init.go @@ -12,6 +12,7 @@ import ( "os" "strings" + "github.com/buildpacks/pack" "github.com/buildpacks/pack/internal/sshdialer" dockerClient "github.com/docker/docker/client" @@ -49,7 +50,7 @@ func tryInitSSHDockerClient() (dockerClient.CommonAPIClient, error) { } dockerClientOpts := []dockerClient.Opt{ - dockerClient.WithVersion("1.38"), + dockerClient.WithVersion(pack.DockerAPIVersion), dockerClient.WithHTTPClient(httpClient), dockerClient.WithHost("http://dummy/"), dockerClient.WithDialContext(dialContext),