Skip to content
Open
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
8 changes: 7 additions & 1 deletion utils/containerd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=containerd
PKG_VERSION:=2.2.3
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:linuxfoundation:containerd
Expand Down Expand Up @@ -40,6 +40,10 @@ define Package/containerd/description
robustness and portability.
endef

define Package/containerd/conffiles
/etc/containerd/config.toml
endef

GO_PKG_INSTALL_EXTRA:=\
vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb \
Makefile \
Expand All @@ -64,6 +68,8 @@ Build/Compile=$(call Build/Compile/Default)
define Package/containerd/install
$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/{ctr,containerd,containerd-stress,containerd-shim-runc-v2} $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/containerd.init $(1)/etc/init.d/containerd
Comment on lines +71 to +72

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please separate adding init file to its own commit, pleaase? It would be better for cherry-picking.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Both changes require bumping PKG_RELEASE so not sure how to achieve that cleanly?

endef

$(eval $(call BuildPackage,containerd))
16 changes: 16 additions & 0 deletions utils/containerd/files/containerd.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2009-2026 OpenWrt.org

START=99
STOP=80

USE_PROCD=1

CONTAINERD_BIN="/usr/bin/containerd"

start_service() {
procd_open_instance
procd_set_param respawn
procd_set_param command $CONTAINERD_BIN
procd_close_instance
Comment on lines +11 to +15

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The service is started without raising the open-file limit. containerd, like the runtime it powers, keeps many file descriptors open (sockets, container fds, shim connections) and the kernel default (often 1024) is easily exhausted. The sibling dockerd.init in this repo sets procd_set_param limits nofile=... for exactly this reason; the standalone containerd instance should do the same.

Suggested change
start_service() {
procd_open_instance
procd_set_param respawn
procd_set_param command $CONTAINERD_BIN
procd_close_instance
start_service() {
local nofile=$(cat /proc/sys/fs/nr_open)
procd_open_instance
procd_set_param respawn
procd_set_param command $CONTAINERD_BIN
procd_set_param limits nofile="${nofile} ${nofile}"
procd_close_instance

Generated by Claude Code

}
6 changes: 5 additions & 1 deletion utils/nerdctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=nerdctl
PKG_VERSION:=1.7.7
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/containerd/nerdctl/tar.gz/v$(PKG_VERSION)?
Expand Down Expand Up @@ -35,5 +35,9 @@ define Package/nerdctl/description
eStargz, OCIcrypt, IPFS, ...
endef

define Package/nerdctl/conffiles
/etc/nerdctl/nerdctl.toml
endef

$(eval $(call GoBinPackage,nerdctl))
$(eval $(call BuildPackage,nerdctl))