Resource limits seem to work ok when not rootless

pull/7631/head
Anders F Björklund 2020-04-14 21:40:20 +02:00
parent 024cd6b108
commit 19be5619d6
1 changed files with 2 additions and 3 deletions

View File

@ -139,11 +139,10 @@ func CreateContainerNode(p CreateParams) error {
}
if p.OCIBinary == Docker {
runArgs = append(runArgs, "--volume", fmt.Sprintf("%s:/var", p.Name))
// setting resource limit in privileged mode is only supported by docker
// podman error: "Error: invalid configuration, cannot set resources with rootless containers not using cgroups v2 unified mode"
runArgs = append(runArgs, fmt.Sprintf("--cpus=%s", p.CPUs), fmt.Sprintf("--memory=%s", p.Memory))
}
runArgs = append(runArgs, fmt.Sprintf("--cpus=%s", p.CPUs), fmt.Sprintf("--memory=%s", p.Memory))
for key, val := range p.Envs {
runArgs = append(runArgs, "-e", fmt.Sprintf("%s=%s", key, val))
}