The flag -c
for the command docker run
changes the weighting of the container CPU share relative to the weighting of all other running containers.
It does not restrict the use of the CPU container from the host machine.
You can use the flag --cpu-quota
to limit CPU usage, for example:
$ docker run -ti --cpu-quota=50000 ubuntu:latest /bin/bash
--cpu-quota
commonly used with --cpu-period
. For more information on the Docker launch control document, see More details:
https://docs.docker.com/reference/run/#runtime-constraints-on-resources