From 81503c30f209595b789770e1134b9f1dbdc3cbe0 Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Mon, 25 Oct 2021 17:25:18 +0200 Subject: [PATCH] chages per review requests Signed-off-by: Matej Vasek --- client.go | 4 +++- cmd/docker_init.go | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) 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),