diff --git a/app/containers/containerd/containerd.confd b/app/containers/containerd/containerd.confd new file mode 100644 index 00000000..22ef8320 --- /dev/null +++ b/app/containers/containerd/containerd.confd @@ -0,0 +1,3 @@ +# This is the delay to be used in the start_post function to wait for +# the socket to be active. +#containerd_socket_delay=5 diff --git a/app/containers/containerd/containerd.initd b/app/containers/containerd/containerd.initd new file mode 100644 index 00000000..609dbc9a --- /dev/null +++ b/app/containers/containerd/containerd.initd @@ -0,0 +1,27 @@ +#!/sbin/openrc-run +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="Containerd container runtime" +command="/usr/bin/containerd" +command_args="${command_args:-}" +command_background="true" +pidfile="${pidfile:-/run/${RC_SVCNAME}.pid}" +start_stop_daemon_args="--stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log --stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log" + +start_pre() { + checkpath -m 0750 -d "/var/log/${RC_SVCNAME}" + + ulimit -n 1048576 + + # Having non-zero limits causes performance problems due to accounting overhead + # in the kernel. We recommend using cgroups to do container-local accounting. + ulimit -u unlimited + + return 0 +} + +start_post() { + ewaitfile ${containerd_socket_delay:-5} /run/containerd/containerd.sock +} + diff --git a/app/containers/containerd/ympbuild b/app/containers/containerd/ympbuild new file mode 100644 index 00000000..1d89fd1b --- /dev/null +++ b/app/containers/containerd/ympbuild @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +name='containerd' +release='1' +version='1.7.10' +url='https://example.org' +description='Package description missing' +email='aliriza.keskin@pardus.org.tr' +maintainer='aliriza' +license=('GPLv3') +source=("https://github.com/containerd/containerd/archive/v$version.tar.gz" + "containerd.initd" + "containerd.confd") +depends=(runc) +makedepends=(go) +md5sums=('0b2cc4244e310fa1cbf8fb3b2c95fbd3' + 'SKIP' + 'SKIP') +group=(app.containers) +uses=() +arch=('x86_64') + +export GOFLAGS="-modcacherw -mod=readonly" +export GOCACHE="$HOME/go-cache" +export GOTMPDIR="$HOME" +export GOMODCACHE="$HOME/go" + +export GO111MODULE=on + +cd $name-$version + +build () { + make VERSION=v$version \ + GO_BUILD_FLAGS="$GOFLAGS" \ + GO_GCFLAGS="" EXTRA_LDFLAGS="-buildid=" \ + STATIC=1 BUILDTAGS=no_systemd +} + +package () { + install -d "$DESTDIR"/usr/bin/ + install -Dm755 ./bin/* "$DESTDIR"/usr/bin/ + + install -Dm755 ../containerd.initd \ + "$DESTDIR"/etc/init.d/containerd + install -Dm644 ../containerd.confd \ + "$DESTDIR"/etc/conf.d/containerd +} +