mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Allow setting ulimits for containers
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
321f4f0683
commit
3f39050637
16 changed files with 365 additions and 10 deletions
|
@ -91,3 +91,18 @@ func TestRunWithVolumesIsRecursive(t *testing.T) {
|
|||
|
||||
logDone("run - volumes are bind mounted recursively")
|
||||
}
|
||||
|
||||
func TestRunWithUlimits(t *testing.T) {
|
||||
defer deleteAllContainers()
|
||||
out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "--name=testulimits", "--ulimit", "nofile=42", "busybox", "/bin/sh", "-c", "ulimit -n"))
|
||||
if err != nil {
|
||||
t.Fatal(err, out)
|
||||
}
|
||||
|
||||
ul := strings.TrimSpace(out)
|
||||
if ul != "42" {
|
||||
t.Fatalf("expected `ulimit -n` to be 42, got %s", ul)
|
||||
}
|
||||
|
||||
logDone("run - ulimits are set")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue