fn: docker version check2 (#744)

1) now required docker version is 17.06
2) enable circle ci latest docker install
3) docker driver & agent check minimum version before start
This commit is contained in:
Tolga Ceylan
2018-02-06 16:16:40 -08:00
committed by GitHub
parent 640a47fe55
commit ebc6657071
16 changed files with 1028 additions and 18 deletions

View File

@@ -38,6 +38,7 @@ type dockerClient interface {
InspectImage(ctx context.Context, name string) (*docker.Image, error)
InspectContainerWithContext(container string, ctx context.Context) (*docker.Container, error)
Stats(opts docker.StatsOptions) error
Info(ctx context.Context) (*docker.DockerInfo, error)
}
// TODO: switch to github.com/docker/engine-api
@@ -169,6 +170,19 @@ func filterNoSuchContainer(ctx context.Context, err error) error {
return err
}
func (d *dockerWrap) Info(ctx context.Context) (info *docker.DockerInfo, err error) {
span, ctx := opentracing.StartSpanFromContext(ctx, "docker_server_version")
defer span.Finish()
ctx, cancel := context.WithTimeout(ctx, retryTimeout)
defer cancel()
err = d.retry(ctx, func() error {
info, err = d.docker.Info()
return err
})
return info, err
}
func (d *dockerWrap) AttachToContainerNonBlocking(ctx context.Context, opts docker.AttachToContainerOptions) (w docker.CloseWaiter, err error) {
span, ctx := opentracing.StartSpanFromContext(ctx, "docker_attach_container")
defer span.Finish()