Merge pull request #1480 from hashicorp/b-docker-disable-swap
Disable swap on docker driver
This commit is contained in:
commit
460fb404b4
|
@ -386,10 +386,11 @@ func (d *DockerDriver) createContainer(ctx *ExecContext, task *structs.Task,
|
|||
OpenStdin: driverConfig.Interactive,
|
||||
}
|
||||
|
||||
memLimit := int64(task.Resources.MemoryMB) * 1024 * 1024
|
||||
hostConfig := &docker.HostConfig{
|
||||
// Convert MB to bytes. This is an absolute value.
|
||||
Memory: int64(task.Resources.MemoryMB) * 1024 * 1024,
|
||||
MemorySwap: -1,
|
||||
Memory: memLimit,
|
||||
MemorySwap: memLimit, // MemorySwap is memory + swap.
|
||||
// Convert Mhz to shares. This is a relative value.
|
||||
CPUShares: int64(task.Resources.CPU),
|
||||
|
||||
|
|
Loading…
Reference in New Issue