Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] rpm: patch RLIMIT_NOFILE for EL 7 systems #968

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ $(DISTROS): sources

.PHONY: sources
sources: rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz rpmbuild/SOURCES/buildx.tgz rpmbuild/SOURCES/compose.tgz
sources: rpmbuild/SOURCES/01-rlimit_nofile-rhel7.patch

rpmbuild/SOURCES/%.patch:
mkdir -p $(@D)
cp $(CURDIR)/patches/$(@F) $@

rpmbuild/SOURCES/engine.tgz:
mkdir -p $(@D)
Expand Down
4 changes: 4 additions & 0 deletions rpm/SPECS/docker-ce.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Version: %{_version}
Release: %{_release}%{?dist}
Epoch: 3
Source0: engine.tgz
Patch0: 01-rlimit_nofile-rhel7.patch
Summary: The open-source application container engine
Group: Tools/Docker
License: ASL 2.0
Expand Down Expand Up @@ -71,6 +72,9 @@ depending on a particular stack or provider.

%prep
%setup -q -c -n src -a 0
%if 0%{?rhel} == 7
%patch -p1 -P 0
%endif

%build

Expand Down
15 changes: 15 additions & 0 deletions rpm/patches/01-rlimit_nofile-rhel7.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git i/engine/contrib/init/systemd/docker.service w/engine/contrib/init/systemd/docker.service
index d8c7867057..b73ecf7363 100644
--- i/engine/contrib/init/systemd/docker.service
+++ w/engine/contrib/init/systemd/docker.service
@@ -30,6 +30,10 @@ StartLimitInterval=60s
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
+# Older systemd versions default to a LimitNOFILE of 1024:1024, which is insufficient for many
+# applications including dockerd itself and will be inherited. Raise the hard limit, while
+# preserving the soft limit for select(2).
+LimitNOFILE=1024:524288

# Comment TasksMax if your systemd version does not support it.
# Only systemd 226 and above support this option.
Comment on lines +14 to +15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but now wondering what version of systemd RHEL/CentOS 7 are running, and if this comment is still relevant (ISTR it was always just a warning, so not even sure if relevant at all)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading