From fa06c65a30c882846ad4e7ef71743b29bc3dfeeb Mon Sep 17 00:00:00 2001 From: Dennis Chen Date: Mon, 5 Feb 2018 02:05:57 +0000 Subject: [PATCH] Daemon: passdown the `--oom-kill-disable` option to containerd Current implementaion of docke daemon doesn't pass down the `--oom-kill-disable` option specified by the end user to the containerd when spawning a new docker instance with help from `runc` component, which results in the `--oom-kill-disable` doesn't work no matter the flag is `true` or `false`. This PR will fix this issue reported by #36090 Signed-off-by: Dennis Chen Signed-off-by: Jianyong Wu Upstream-commit: 44b074d199de84b9af8cc94005fbed4f76bd9ab8 Component: engine --- components/engine/daemon/daemon_unix.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/engine/daemon/daemon_unix.go b/components/engine/daemon/daemon_unix.go index de9537c1b0..950de3f213 100644 --- a/components/engine/daemon/daemon_unix.go +++ b/components/engine/daemon/daemon_unix.go @@ -103,6 +103,10 @@ func getMemoryResources(config containertypes.Resources) *specs.LinuxMemory { memory.Swappiness = &swappiness } + if config.OomKillDisable != nil { + memory.DisableOOMKiller = config.OomKillDisable + } + if config.KernelMemory != 0 { memory.Kernel = &config.KernelMemory }