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
The installation process is omitted (I installed ...
Introduction yum (Yellow dog Updater, Modified) i...
Table of contents Manual backup Timer backup Manu...
1. Question: I have been doing insert operations ...
Today someone talked to me about a website develo...
background When I was using Docker these two days...
Today I found a problem in HTML. There are many d...
Table of contents 1. Scenario 2. Basic functions ...
Table of contents Prototype chain We can implemen...
Introduction to MySQL logical architecture Overvi...
To back up multiple databases, you can use the fo...
1. Installation and use First, install it in your...
Table of contents 1. Docker enables remote access...
Table of contents 1. Why is JavaScript single-thr...
Preface Query optimization is not something that ...