Merge pull request #57 from dolanor/compose-compatibility

Make the algorithm follow docker-compose more precisely
pull/59/head
Fabrizio Steiner 8 years ago committed by GitHub
commit 88f7262f1d

@ -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
} }

Loading…
Cancel
Save