mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 18:11:35 +00:00
Don't use deprecated api
Signed-off-by: David Gageot <david.gageot@docker.com>
This commit is contained in:
parent
d589bd18f1
commit
4df610741d
@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/containerd/containerd/reference"
|
||||
dockertypes "github.com/docker/docker/api/types"
|
||||
@ -15,13 +14,15 @@ import (
|
||||
|
||||
// Client get a docker client.
|
||||
func Client() (*client.Client, error) {
|
||||
// for maximum compatibility as we use nothing new
|
||||
// 1.30 corresponds to Docker 17.06, supported until 2020.
|
||||
err := os.Setenv("DOCKER_API_VERSION", "1.30")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
options := []client.Opt{
|
||||
// for maximum compatibility as we use nothing new
|
||||
// 1.30 corresponds to Docker 17.06, supported until 2020.
|
||||
client.WithVersion("1.30"),
|
||||
client.WithTLSClientConfigFromEnv(),
|
||||
client.WithHostFromEnv(),
|
||||
}
|
||||
return client.NewEnvClient()
|
||||
|
||||
return client.NewClientWithOpts(options...)
|
||||
}
|
||||
|
||||
// HasImage check if the provided ref is available in the docker cache.
|
||||
|
Loading…
Reference in New Issue
Block a user