Fix MemorySwappiness on Windows Docker

Fixes https://github.com/hashicorp/nomad/issues/3181
This commit is contained in:
Alex Dadgar
2017-09-10 17:46:45 -07:00
parent 03e63d0516
commit 7148b65306

View File

@@ -970,8 +970,11 @@ func (d *DockerDriver) createContainerConfig(ctx *ExecContext, task *structs.Tas
VolumeDriver: driverConfig.VolumeDriver,
}
// Windows does not support MemorySwap #2193
if runtime.GOOS != "windows" {
// Windows does not support MemorySwap/MemorySwappiness #2193
if runtime.GOOS == "windows" {
hostConfig.MemorySwap = 0
hostConfig.MemorySwappiness = -1
} else {
hostConfig.MemorySwap = memLimit // MemorySwap is memory + swap.
}