From 72c8ba7ee56fd7818e480991e37db0ed8ac7e97a Mon Sep 17 00:00:00 2001 From: Student414 <805447391@qq.com> Date: Fri, 30 Aug 2019 01:08:13 +0100 Subject: [PATCH] docker-ce: Expand nofile from 1024(soft) 4096(hard) as large as possible when using procd. 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 | 2 +- utils/docker-ce/files/dockerd.init | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/docker-ce/Makefile b/utils/docker-ce/Makefile index ced993ad3..19f16462b 100644 --- a/utils/docker-ce/Makefile +++ b/utils/docker-ce/Makefile @@ -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 diff --git a/utils/docker-ce/files/dockerd.init b/utils/docker-ce/files/dockerd.init index d53c17178..6faea9f74 100644 --- a/utils/docker-ce/files/dockerd.init +++ b/utils/docker-ce/files/dockerd.init @@ -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 }