Reuse the network config for the relaunch

pull/33/head
Tanguy ⧓ Herrmann 8 years ago
parent 96466dbcf7
commit fe0e34e857

@ -8,6 +8,7 @@ import (
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
dockerclient "github.com/docker/docker/client" dockerclient "github.com/docker/docker/client"
"github.com/docker/docker/api/types" "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/network"
"golang.org/x/net/context" "golang.org/x/net/context"
) )
@ -118,10 +119,11 @@ func (client dockerClient) StartContainer(c Container) error {
bg := context.Background(); bg := context.Background();
config := c.runtimeConfig() config := c.runtimeConfig()
hostConfig := c.hostConfig() hostConfig := c.hostConfig()
networkConfig := &network.NetworkingConfig{EndpointsConfig: c.containerInfo.NetworkSettings.Networks}
name := c.Name() name := c.Name()
log.Infof("Starting %s", 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 { if err != nil {
return err return err
} }

Loading…
Cancel
Save