Use locked API version to ensure compatibility

This commit is contained in:
cuigh 2017-11-22 16:00:20 +08:00
parent 62ede94143
commit 317446e5cd

View File

@ -2,6 +2,7 @@ package docker
import ( import (
"context" "context"
"os"
"sync" "sync"
"github.com/cuigh/auxo/log" "github.com/cuigh/auxo/log"
@ -36,6 +37,7 @@ func (m *manager) Client() (ctx context.Context, cli *client.Client, err error)
if m.client == nil { if m.client == nil {
if misc.Options.DockerEndpoint == "" { if misc.Options.DockerEndpoint == "" {
os.Setenv("DOCKER_API_VERSION", apiVersion)
m.client, err = client.NewEnvClient() m.client, err = client.NewEnvClient()
} else { } else {
m.client, err = client.NewClient(misc.Options.DockerEndpoint, apiVersion, nil, nil) m.client, err = client.NewClient(misc.Options.DockerEndpoint, apiVersion, nil, nil)