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

containerd: add rc.d args and sample config #160

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion sysutils/containerd/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PORTNAME= containerd
DISTVERSIONPREFIX=v
DISTVERSION= 1.6.17
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= sysutils

MAINTAINER= decke@FreeBSD.org
Expand Down Expand Up @@ -33,4 +33,8 @@ PLIST_FILES= bin/containerd \
do-install:
@(cd ${WRKSRC} && ${SETENV} DESTDIR="${STAGEDIR}" ${MAKE_CMD} install)

post-install:
${MKDIR} ${STAGEDIR}${PREFIX}/etc/containerd
${CP} ${FILESDIR}/*.sample ${STAGEDIR}${PREFIX}/etc/containerd

.include <bsd.port.mk>
35 changes: 35 additions & 0 deletions sysutils/containerd/files/config.toml.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
state = "/var/run/containerd"
temp = ""
version = 2

[cgroup]
path = ""

[debug]
address = "/var/run/containerd/debug.sock"
format = ""
gid = 0
level = "info"
uid = 0

[grpc]
address = "/var/run/containerd/containerd.sock"
gid = 0
max_recv_message_size = 16777216
max_send_message_size = 16777216
tcp_address = ""
tcp_tls_ca = ""
tcp_tls_cert = ""
tcp_tls_key = ""
uid = 0

[plugins]
[plugins."io.containerd.service.v1.diff-service"]
default = ["walking"]
[plugins."io.containerd.gc.v1.scheduler"]
pause_threshold = 0.02
deletion_threshold = 0
mutation_threshold = 100
schedule_delay = "0s"
startup_delay = "100ms"

9 changes: 5 additions & 4 deletions sysutils/containerd/files/containerd.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
name="containerd"
rcvar="containerd_enable"

pidfile="/var/run/${name}.pid"
command="/usr/sbin/daemon"
command_args="-P ${pidfile} -r -S -t ${name} -T ${name} %%LOCALBASE%%/bin/containerd"

load_rc_config $name
: ${containerd_enable:=no}
: ${containerd_args:=""}
Copy link
Member

Choose a reason for hiding this comment

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

name_flags can always be used in rc.conf, even if not defined in the rc script to add additional flags to command_args.
This is done in rc.subr so it should not be duplicated in the rc script.


pidfile="/var/run/${name}.pid"
command="/usr/sbin/daemon"
command_args="-P ${pidfile} -r -S -t ${name} -T ${name} %%LOCALBASE%%/bin/containerd ${containerd_args}"

# containerd needs to execute a runtime (eg. runj)
PATH="${PATH}:%%PREFIX%%/sbin:%%PREFIX%%/bin"
Expand Down