Skip to content

Commit fe0e34e

Browse files
committed
Reuse the network config for the relaunch
1 parent 96466db commit fe0e34e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

container/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
log "github.com/Sirupsen/logrus"
99
dockerclient "github.com/docker/docker/client"
1010
"github.com/docker/docker/api/types"
11+
"github.com/docker/docker/api/types/network"
1112
"golang.org/x/net/context"
1213
)
1314

@@ -118,10 +119,11 @@ func (client dockerClient) StartContainer(c Container) error {
118119
bg := context.Background();
119120
config := c.runtimeConfig()
120121
hostConfig := c.hostConfig()
122+
networkConfig := &network.NetworkingConfig{EndpointsConfig: c.containerInfo.NetworkSettings.Networks}
121123
name := c.Name()
122124

123125
log.Infof("Starting %s", name)
124-
creation, err := client.api.ContainerCreate(bg, config, hostConfig, nil, name)
126+
creation, err := client.api.ContainerCreate(bg, config, hostConfig, networkConfig, name)
125127
if err != nil {
126128
return err
127129
}

0 commit comments

Comments
 (0)