diff --git a/CHANGELOG.md b/CHANGELOG.md index f2f384097..606883baa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ BUG FIXES: * client: Fix race condition with deriving vault tokens [GH-2275] * config: Fix Consul Config Merging/Copying [GH-2278] * config: Fix Client reserved resource merging panic [GH-2281] + * driver/docker: Fix Docker 1.13 on Windows [GH-2342] * server: Fix panic when forwarding Vault derivation requests from non-leader servers [GH-2267] diff --git a/client/driver/docker.go b/client/driver/docker.go index 0874cd970..8536a6c2a 100644 --- a/client/driver/docker.go +++ b/client/driver/docker.go @@ -753,8 +753,7 @@ func (d *DockerDriver) createContainerConfig(ctx *ExecContext, task *structs.Tas hostConfig := &docker.HostConfig{ // Convert MB to bytes. This is an absolute value. - Memory: memLimit, - MemorySwap: memLimit, // MemorySwap is memory + swap. + Memory: memLimit, // Convert Mhz to shares. This is a relative value. CPUShares: int64(task.Resources.CPU), @@ -764,6 +763,11 @@ func (d *DockerDriver) createContainerConfig(ctx *ExecContext, task *structs.Tas Binds: binds, } + // Windows does not support MemorySwap #2193 + if runtime.GOOS != "windows" { + hostConfig.MemorySwap = memLimit // MemorySwap is memory + swap. + } + if len(driverConfig.Logging) != 0 { d.logger.Printf("[DEBUG] driver.docker: Using config for logging: %+v", driverConfig.Logging[0]) hostConfig.LogConfig = docker.LogConfig{