I'm running my container with
docker run --rm -it --cpus=1 --memory "8G" -v "$pwd":"/code/" 'algolab' bash
This means according to the docs that the container will only use one cpu core.
--cpus=0.000Number of CPUs.
Number is a fractional number. 0.000 means no limit.
But when I run nproc inside the container, it tells me it sees 8 cores - the same number as on my host.
This answer supports that claim. But it also mentions --cpuset-cpus="0-2". When I use that, in addition to --cpus=1, I get the result 3 from nproc.
Why is docker ignoring --cpus=1?
And how do I make it stop ignoring it?
For now, I can use --cpuset-cpus="0", but I don't understand why that's necessary.
$ docker --version
Docker version 19.03.6, build 369ce74a3c