Skip to content

cgroups: limits, and why exit code 137 happens

Select an icon to see what it is.

Step 1 of 6

Limits travel in HostConfig

docker run -m 256m --cpus 0.5 puts the limits into the create request. -m becomes Memory in bytes, and --cpus becomes NanoCpus. Nothing is enforced until the process exists.

$ docker run -d --name web -m 256m --cpus 0.5 nginx
PrevNext

POST /v1.45/containers/create?name=web

{
"Image": "nginx"
"HostConfig": {
"Memory": 268435456
"NanoCpus": 500000000
}
}