Make sure createHostConfig is called only once
The second call discards any mods to port binding or network type Fixes #185 and #196
This commit is contained in:
parent
191ea91cdd
commit
3751b46673
|
@ -267,7 +267,7 @@ func (d *DockerDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle
|
||||||
d.logger.Printf("[INFO] driver.docker: created container %s", container.ID)
|
d.logger.Printf("[INFO] driver.docker: created container %s", container.ID)
|
||||||
|
|
||||||
// Start the container
|
// Start the container
|
||||||
err = client.StartContainer(container.ID, createHostConfig(task))
|
err = client.StartContainer(container.ID, container.HostConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
d.logger.Printf("[ERR] driver.docker: starting container %s", container.ID)
|
d.logger.Printf("[ERR] driver.docker: starting container %s", container.ID)
|
||||||
return nil, fmt.Errorf("Failed to start container %s", container.ID)
|
return nil, fmt.Errorf("Failed to start container %s", container.ID)
|
||||||
|
|
Loading…
Reference in a new issue