docker-ce: Expand nofile from 1024(soft) 4096(hard) as large as possible when using...
authorStudent414 <805447391@qq.com>
Fri, 30 Aug 2019 00:08:13 +0000 (01:08 +0100)
committerStudent414 <805447391@qq.com>
Fri, 30 Aug 2019 00:08:13 +0000 (01:08 +0100)
When we run docker image and export too many ports, dockerd will output some errors like "too many open files", it is caused by max-file limitation.
Now, we start dockerd using procd, just add a statement to fix this problem.

Signed-off-by: Fuying Wang <805447391@qq.com>
utils/docker-ce/Makefile
utils/docker-ce/files/dockerd.init

index ced993ad3258cfbb9ec8365ae8c5544a628edbfb..19f16462b79bd639868943e4a23832295ad97eaf 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=docker-ce
 PKG_VERSION:=19.03.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=components/cli/LICENSE components/engine/LICENSE
 
index d53c17178b349899d08ad486f296856d54b8710c..6faea9f74450c2c0e83602a81678a3a4dc26fe79 100644 (file)
@@ -4,7 +4,10 @@ USE_PROCD=1
 START=25
 
 start_service() {
+       local nofile=$(cat /proc/sys/fs/nr_open)
+       
        procd_open_instance
        procd_set_param command /usr/bin/dockerd
+       procd_set_param limits nofile="${nofile} ${nofile}"
        procd_close_instance
 }