From 9b755412ab03816f0b7d6013618c65ae68781bcb Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 22 Sep 2014 20:50:36 +0000 Subject: [PATCH] Update memory limit for container Signed-off-by: Michael Crosby --- daemon/create.go | 4 ++-- integration-cli/docker_cli_run_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/create.go b/daemon/create.go index 4fb58480b..a66831e78 100644 --- a/daemon/create.go +++ b/daemon/create.go @@ -15,8 +15,8 @@ func (daemon *Daemon) ContainerCreate(job *engine.Job) engine.Status { return job.Errorf("Usage: %s", job.Name) } config := runconfig.ContainerConfigFromJob(job) - if config.Memory != 0 && config.Memory < 524288 { - return job.Errorf("Minimum memory limit allowed is 512k") + if config.Memory != 0 && config.Memory < 4194304 { + return job.Errorf("Minimum memory limit allowed is 4MB") } if config.Memory > 0 && !daemon.SystemConfig().MemoryLimit { job.Errorf("Your kernel does not support memory limit capabilities. Limitation discarded.\n") diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go index df49f0f4b..1b6719a89 100644 --- a/integration-cli/docker_cli_run_test.go +++ b/integration-cli/docker_cli_run_test.go @@ -40,7 +40,7 @@ func TestRunEchoStdout(t *testing.T) { // "test" should be printed func TestRunEchoStdoutWithMemoryLimit(t *testing.T) { - runCmd := exec.Command(dockerBinary, "run", "-m", "2786432", "busybox", "echo", "test") + runCmd := exec.Command(dockerBinary, "run", "-m", "4m", "busybox", "echo", "test") out, _, _, err := runCommandWithStdoutStderr(runCmd) if err != nil { t.Fatalf("failed to run container: %v, output: %q", err, out) @@ -77,7 +77,7 @@ func TestRunEchoStdoutWitCPULimit(t *testing.T) { // "test" should be printed func TestRunEchoStdoutWithCPUAndMemoryLimit(t *testing.T) { - runCmd := exec.Command(dockerBinary, "run", "-c", "1000", "-m", "2786432", "busybox", "echo", "test") + runCmd := exec.Command(dockerBinary, "run", "-c", "1000", "-m", "4m", "busybox", "echo", "test") out, _, _, err := runCommandWithStdoutStderr(runCmd) if err != nil { t.Fatalf("failed to run container: %v, output: %q", err, out)