|
|
@ -134,19 +134,12 @@ func (client dockerClient) StartContainer(c Container) error {
|
|
|
|
|
|
|
|
|
|
|
|
name := c.Name()
|
|
|
|
name := c.Name()
|
|
|
|
|
|
|
|
|
|
|
|
log.Infof("Starting %s", name)
|
|
|
|
log.Infof("Creating %s", name)
|
|
|
|
creation, err := client.api.ContainerCreate(bg, config, hostConfig, simpleNetworkConfig, name)
|
|
|
|
creation, err := client.api.ContainerCreate(bg, config, hostConfig, simpleNetworkConfig, name)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
log.Debugf("Starting container %s (%s)", name, creation.ID)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err = client.api.ContainerStart(bg, creation.ID, types.ContainerStartOptions{})
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for k := range simpleNetworkConfig.EndpointsConfig {
|
|
|
|
for k := range simpleNetworkConfig.EndpointsConfig {
|
|
|
|
err = client.api.NetworkDisconnect(bg, k, creation.ID, true)
|
|
|
|
err = client.api.NetworkDisconnect(bg, k, creation.ID, true)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
@ -160,6 +153,14 @@ func (client dockerClient) StartContainer(c Container) error {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.Debugf("Starting container %s (%s)", name, creation.ID)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err = client.api.ContainerStart(bg, creation.ID, types.ContainerStartOptions{})
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|