Merge branch 'master' into next

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-10-31 16:28:31 -03:00
7 changed files with 53 additions and 16 deletions

View File

@@ -340,18 +340,18 @@ func (d *docker) CreateContainer(opts CreateContainerOpts) (err error) {
container, err := d.c.ContainerCreate(context.Background(), cf, h, networkConf, opts.ContainerName)
if err != nil {
if client.IsErrNotFound(err) {
log.Printf("Unable to find image '%s' locally\n", opts.Image)
if err = d.pullImage(context.Background(), opts.Image); err != nil {
return
}
container, err = d.c.ContainerCreate(context.Background(), cf, h, networkConf, opts.ContainerName)
if err != nil {
return
}
} else {
return
}
//if client.IsErrImageNotFound(err) {
//log.Printf("Unable to find image '%s' locally\n", opts.Image)
//if err = d.pullImage(context.Background(), opts.Image); err != nil {
//return "", err
//}
//container, err = d.c.ContainerCreate(context.Background(), cf, h, networkConf, opts.ContainerName)
//if err != nil {
//return "", err
//}
//} else {
return err
//}
}
//connect remaining networks if there are any