as follows:-m, --memory Memory limit, the format is a number plus a unit, the unit can be b, k, m, g. Minimum 4M --memory-swap Total limit of memory + swap partition size. Same format as above. Required -m sets the soft limit on memory. Same format as above --oom-kill-disable Whether to prevent OOM killer from killing containers, not set by default --oom-score-adj The priority of the container being killed by OOM killer, the range is [-1000, 1000], the default is 0 --memory-swappiness is used to set the virtual memory control behavior of the container. The value is an integer between 0 and 100. --kernel-memory Kernel memory limit. Same format as above, minimum size is 4M See examples:[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 Supplement: Docker run -m specifies the memory size but it does not take effect When executing docker run, I want to specify the memory size, so I use the -m parameter The error is as follows
Then I found that although I set the heap size to 5G, the container was still created and the 3G limit did not take effect. After checking the information, I found that this error was because the relevant functions of the host kernel were not enabled. SolutionJust follow the settings below Step 1: Edit the /etc/default/grub file and change the GRUB_CMDLINE_LINUX line to GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1" Step 2: Update GRUB, that is, execute $ sudo update-grub Step 3: Reboot the system. The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me. You may also be interested in:
|
<<: Comparative Analysis of MySQL Binlog Log Processing Tools
>>: Differences and usage examples of for, for...in, for...of and forEach in JS
This is an effect created purely using CSS. To pu...
System environment: centos7.4 1. Check whether th...
1. Introduction The EXPLAIN statement provides in...
Effect The pictures in the code can be changed by...
First method Alibaba Cloud and Baidu Cloud server...
I spent a day on it before this. Although Seata i...
Preface The origin is a question 1: If your umask...
MYSQL officially provides an Installer method to ...
Table of contents Backend: Rails API part Front-e...
Many friends found that the box model is a square...
The image can be saved on hub.docker.com, but the...
Official documentation: https://nginx.org/en/linu...
Table of contents Vue first screen performance op...
question Adding the type of uploaded file in acce...
Delayed loading (lazy loading) and preloading are...