Disable image pulling and update docker cli

This commit is contained in:
Marcos Lilljedahl
2017-10-24 15:29:18 -03:00
parent 4f9e58584b
commit 70fb34d3d5

View File

@@ -275,18 +275,18 @@ func (d *docker) CreateContainer(opts CreateContainerOpts) (string, error) {
container, err := d.c.ContainerCreate(context.Background(), cf, h, networkConf, opts.ContainerName) container, err := d.c.ContainerCreate(context.Background(), cf, h, networkConf, opts.ContainerName)
if err != nil { if err != nil {
if client.IsErrImageNotFound(err) { //if client.IsErrImageNotFound(err) {
log.Printf("Unable to find image '%s' locally\n", opts.Image) //log.Printf("Unable to find image '%s' locally\n", opts.Image)
if err = d.pullImage(context.Background(), opts.Image); err != nil { //if err = d.pullImage(context.Background(), opts.Image); err != nil {
return "", err //return "", err
} //}
container, err = d.c.ContainerCreate(context.Background(), cf, h, networkConf, opts.ContainerName) //container, err = d.c.ContainerCreate(context.Background(), cf, h, networkConf, opts.ContainerName)
if err != nil { //if err != nil {
return "", err //return "", err
} //}
} else { //} else {
return "", err return "", err
} //}
} }
if err := d.copyIfSet(opts.ServerCert, "cert.pem", containerCertDir, opts.ContainerName); err != nil { if err := d.copyIfSet(opts.ServerCert, "cert.pem", containerCertDir, opts.ContainerName); err != nil {
@@ -346,7 +346,7 @@ func (d *docker) ExecAttach(instanceName string, command []string, out io.Writer
if err != nil { if err != nil {
return 0, err return 0, err
} }
resp, err := d.c.ContainerExecAttach(context.Background(), e.ID, types.ExecConfig{AttachStdout: true, AttachStderr: true, Tty: true}) resp, err := d.c.ContainerExecAttach(context.Background(), e.ID, types.ExecStartCheck{Tty: true})
if err != nil { if err != nil {
return 0, err return 0, err
} }