Merge pull request #2342 from hashicorp/b-docker-noswap-on-win

Skip setting MemorySwap on Windows
This commit is contained in:
Michael Schurter
2017-02-21 15:56:44 -08:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@@ -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]

View File

@@ -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{