mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
Passing memory swap limit -1 by default. Docker remote API never check if memory
swap is enabled by kernel or not, instead by default to set the limit to
memory * 2, and return API error 500 if swap is not enabled.
(cherry picked from commit f714020a7a
)
This commit is contained in:
parent
3e5707be5b
commit
a90d47da60
@ -584,6 +584,7 @@ func (dm *DockerManager) runContainer(
|
|||||||
Image: container.Image,
|
Image: container.Image,
|
||||||
// Memory and CPU are set here for older versions of Docker (pre-1.6).
|
// Memory and CPU are set here for older versions of Docker (pre-1.6).
|
||||||
Memory: memoryLimit,
|
Memory: memoryLimit,
|
||||||
|
MemorySwap: -1,
|
||||||
CPUShares: cpuShares,
|
CPUShares: cpuShares,
|
||||||
WorkingDir: container.WorkingDir,
|
WorkingDir: container.WorkingDir,
|
||||||
Labels: labels,
|
Labels: labels,
|
||||||
@ -635,6 +636,7 @@ func (dm *DockerManager) runContainer(
|
|||||||
IpcMode: ipcMode,
|
IpcMode: ipcMode,
|
||||||
// Memory and CPU are set here for newer versions of Docker (1.6+).
|
// Memory and CPU are set here for newer versions of Docker (1.6+).
|
||||||
Memory: memoryLimit,
|
Memory: memoryLimit,
|
||||||
|
MemorySwap: -1,
|
||||||
CPUShares: cpuShares,
|
CPUShares: cpuShares,
|
||||||
}
|
}
|
||||||
if len(opts.DNS) > 0 {
|
if len(opts.DNS) > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user