From fe0e34e8577026feac6b3d3a42dcc80a4c190043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tanguy=20=E2=A7=93=20Herrmann?= Date: Sat, 17 Dec 2016 22:50:36 +0100 Subject: [PATCH] Reuse the network config for the relaunch --- container/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/container/client.go b/container/client.go index cf2e589..86e1719 100644 --- a/container/client.go +++ b/container/client.go @@ -8,6 +8,7 @@ import ( log "github.com/Sirupsen/logrus" dockerclient "github.com/docker/docker/client" "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/network" "golang.org/x/net/context" ) @@ -118,10 +119,11 @@ func (client dockerClient) StartContainer(c Container) error { bg := context.Background(); config := c.runtimeConfig() hostConfig := c.hostConfig() + networkConfig := &network.NetworkingConfig{EndpointsConfig: c.containerInfo.NetworkSettings.Networks} name := c.Name() log.Infof("Starting %s", name) - creation, err := client.api.ContainerCreate(bg, config, hostConfig, nil, name) + creation, err := client.api.ContainerCreate(bg, config, hostConfig, networkConfig, name) if err != nil { return err }