-m,--memory 内存限制,格式是数字加单位,单位可以为 b,k,m,g。最小为 4M
--memory-swap 内存+交换分区大小总限制。格式同上。必须必-m设置的大
--memory-reservation 内存的软性限制。格式同上
--oom-kill-disable 是否阻止 OOM killer 杀死容器,默认没设置
--oom-score-adj 容器被 OOM killer 杀死的优先级,范围是[-1000, 1000],默认为 0
--memory-swappiness 用于设置容器的虚拟内存控制行为。值为 0~100 之间的整数
--kernel-memory 核心内存限制。格式同上,最小为 4M
查看事例:
[root@sannian ~]# docker run -d -m 1G --memory-swap 3G -p 9999:80 --restart=always --name gitlab twang2218/gitlab-ce-zh
a3254078a79a084f3f3bed5f4ade3e26c7d86951cd822d95b113227d75b00097
[root@sannian ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a3254078a79a twang2218/gitlab-ce-zh "/assets/wrapper" 21 minutes ago Up 2 minutes (healthy) 22/tcp, 443/tcp, 0.0.0.0:9999->80/tcp gitlab
[root@sannian ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
twang2218/gitlab-ce-zh latest 18da462b5ff5 3 months ago 1.61GB
registry-vpc.cn-hangzhou.aliyuncs.com/wenty/jumpserver latest 055f42f305f5 7 months ago 1.41GB
registry.cn-hangzhou.aliyuncs.com/wenty/jumpserver latest 055f42f305f5 7 months ago 1.41GB
registry.jumpserver.org/public/jumpserver 1.0.0 055f42f305f5 7 months ago 1.41GB
registry.jumpserver.org/public/jumpserver latest 055f42f305f5 7 months ago 1.41GB