mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-22 05:40:50 +02:00
Make the algorithm follow docker-compose more precisely
https://github.com/v2tec/watchtower/pull/40#discussion_r97719974
This commit is contained in:
parent
ce321242bf
commit
a5c3e1e05a
1 changed files with 9 additions and 8 deletions
|
@ -134,19 +134,12 @@ func (client dockerClient) StartContainer(c Container) error {
|
|||
|
||||
name := c.Name()
|
||||
|
||||
log.Infof("Starting %s", name)
|
||||
log.Infof("Creating %s", name)
|
||||
creation, err := client.api.ContainerCreate(bg, config, hostConfig, simpleNetworkConfig, name)
|
||||
if err != nil {
|
||||
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 {
|
||||
err = client.api.NetworkDisconnect(bg, k, creation.ID, true)
|
||||
if err != nil {
|
||||
|
@ -160,6 +153,14 @@ func (client dockerClient) StartContainer(c Container) error {
|
|||
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
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue