mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
do not warning when we disable memoryswap
$ docker run -ti --rm -m 300M --memory-swap=-1 ubuntu:14.04 WARNING: Your kernel does not support swap limit capabilities. Limitation discarded. root@813aafc019d5:/# When we disable memoryswap, it should not warning swap limit not support. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
parent
a5269223a7
commit
55cc166e53
1 changed files with 1 additions and 1 deletions
|
@ -33,7 +33,7 @@ func (daemon *Daemon) ContainerCreate(job *engine.Job) engine.Status {
|
|||
job.Errorf("Your kernel does not support memory limit capabilities. Limitation discarded.\n")
|
||||
hostConfig.Memory = 0
|
||||
}
|
||||
if hostConfig.Memory > 0 && !daemon.SystemConfig().SwapLimit {
|
||||
if hostConfig.Memory > 0 && hostConfig.MemorySwap != -1 && !daemon.SystemConfig().SwapLimit {
|
||||
job.Errorf("Your kernel does not support swap limit capabilities. Limitation discarded.\n")
|
||||
hostConfig.MemorySwap = -1
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue