diff --git a/daemon/execdriver/driver_unix.go b/daemon/execdriver/driver_unix.go index 93c710985f..528f06dc74 100644 --- a/daemon/execdriver/driver_unix.go +++ b/daemon/execdriver/driver_unix.go @@ -161,6 +161,7 @@ func SetupCgroups(container *configs.Config, c *Command) error { container.Cgroups.Memory = c.Resources.Memory container.Cgroups.MemoryReservation = c.Resources.MemoryReservation container.Cgroups.MemorySwap = c.Resources.MemorySwap + container.Cgroups.KernelMemory = c.Resources.KernelMemory container.Cgroups.CpusetCpus = c.Resources.CpusetCpus container.Cgroups.CpusetMems = c.Resources.CpusetMems container.Cgroups.CpuPeriod = c.Resources.CPUPeriod diff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go index 035c2ddf86..1f26bde7e3 100644 --- a/integration-cli/docker_cli_run_unix_test.go +++ b/integration-cli/docker_cli_run_unix_test.go @@ -162,7 +162,9 @@ func (s *DockerSuite) TestRunWithCpuPeriod(c *check.C) { func (s *DockerSuite) TestRunWithKernelMemory(c *check.C) { testRequires(c, kernelMemorySupport) - dockerCmd(c, "run", "--kernel-memory", "50M", "--name", "test1", "busybox", "true") + file := "/sys/fs/cgroup/memory/memory.kmem.limit_in_bytes" + out, _ := dockerCmd(c, "run", "--kernel-memory", "50M", "--name", "test1", "busybox", "cat", file) + c.Assert(out, checker.Contains, "52428800") out, err := inspectField("test1", "HostConfig.KernelMemory") c.Assert(err, check.IsNil)