From 3751b46673a6c521fc412d870892ce81d6ce4a45 Mon Sep 17 00:00:00 2001 From: Abhishek Chanda Date: Fri, 2 Oct 2015 10:43:37 -0700 Subject: [PATCH] Make sure createHostConfig is called only once The second call discards any mods to port binding or network type Fixes #185 and #196 --- client/driver/docker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/driver/docker.go b/client/driver/docker.go index beca0c509..a36dfa6d0 100644 --- a/client/driver/docker.go +++ b/client/driver/docker.go @@ -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) // Start the container - err = client.StartContainer(container.ID, createHostConfig(task)) + err = client.StartContainer(container.ID, container.HostConfig) if err != nil { d.logger.Printf("[ERR] driver.docker: starting container %s", container.ID) return nil, fmt.Errorf("Failed to start container %s", container.ID)