1.内存:docker run -it -m 200M --memory-swap=300M progrium/stress --vm 1 --vm-bytes 500M
刚开始会报错:
docker: Error response from daemon: mkdir /var/lib/docker/overlay/8653d32d82c4c106fde295893c582ea446188e4b7ee665b7e6af9e24689f71ad-init/merged/dev/shm: invalid argument.
See 'docker run --help'.
vim /etc/docker/daemon.json
"storage-driver": "devicemapper"
参考:https://blog.csdn.net/qq_21816375/article/details/82112685
2.CPU:--cpu
用来设置工作线程的数量
docker run --name "container_A" -c 1024 ubuntu
参考:https://www.cnblogs.com/CloudMan6/p/7003199.html