使用 --cpus=<value> 命令,在 docker run的时候进行分配,If you have 1 CPU, each of the following commands guarantees the container at most 50% of the CPU every second.Docker 1.13 and higher:docker run -it --cpus=".5" ubuntu /bin/bashDocker 1.12 and lower:
$ docker run -it --cpu-period=100000 --cpu-quota=50000 ubuntu /bin/bash更多的参数可以参考:Limit a container's resources