实战
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1fb916fb0e13 6a "sh" 2 hours ago Created hello2
9fb1ff8de577 6a "sh" 2 hours ago Up 7 minutes hello
[root@localhost ~]# docker start 1
1
[root@localhost ~]# docker stats
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
9fb1ff8de577 0.00% 56KiB / 993MiB 0.01% 648B / 0B 0B / 0B 0
^C
[root@localhost ~]# docker update -m 500m --memory-swap -1 9f
9f
[root@localhost ~]# docker stats
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
9fb1ff8de577 0.00% 56KiB / 500MiB 0.01% 648B / 0B 0B / 0B 0
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
9fb1ff8de577 0.00% 56KiB / 500MiB 0.01% 648B / 0B 0B / 0B 0
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
9fb1ff8de577 0.00% 56KiB / 500MiB 0.01% 648B / 0B 0B / 0B 0
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
9fb1ff8de577 0.00% 56KiB / 500MiB 0.01% 648B / 0B 0B / 0B 0
来源:CSDN
作者:cakincqm
链接:https://blog.csdn.net/chengqiuming/article/details/78987167