summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Rüger <mrueg@gentoo.org>2018-11-09 11:42:48 +0100
committerManuel Rüger <mrueg@gentoo.org>2018-11-09 11:42:48 +0100
commitb7bd9e0c49bca1682b7707425298c102ce813d71 (patch)
treee7cc863e4973c593c2573a5d8b99acf0284cc4cf /app-emulation/containerd
parentapp-emulation/docker: Deprecate devicemapper (diff)
downloadgentoo-b7bd9e0c49bca1682b7707425298c102ce813d71.tar.gz
gentoo-b7bd9e0c49bca1682b7707425298c102ce813d71.tar.bz2
gentoo-b7bd9e0c49bca1682b7707425298c102ce813d71.zip
app-emulation/containerd: Add initscript, drop docker-runc dep
Signed-off-by: Manuel Rüger <mrueg@gentoo.org> Package-Manager: Portage-2.3.51, Repoman-2.3.11
Diffstat (limited to 'app-emulation/containerd')
-rw-r--r--app-emulation/containerd/containerd-1.2.0-r1.ebuild56
-rw-r--r--app-emulation/containerd/files/containerd.initd18
2 files changed, 74 insertions, 0 deletions
diff --git a/app-emulation/containerd/containerd-1.2.0-r1.ebuild b/app-emulation/containerd/containerd-1.2.0-r1.ebuild
new file mode 100644
index 000000000000..27e3a7531553
--- /dev/null
+++ b/app-emulation/containerd/containerd-1.2.0-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+EGO_PN="github.com/containerd/${PN}"
+
+inherit toolchain-funcs
+
+if [[ ${PV} == *9999 ]]; then
+ inherit golang-vcs
+else
+ MY_PV="${PV/_rc/-rc.}"
+ EGIT_COMMIT="v${MY_PV}"
+ CONTAINERD_COMMIT="c4446665cb9c30056f4998ed953e6d4ff22c7c39"
+ SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc64"
+ inherit golang-vcs-snapshot
+fi
+
+DESCRIPTION="A daemon to control runC"
+HOMEPAGE="https://containerd.tools"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="apparmor +btrfs +cri hardened +seccomp"
+
+DEPEND="btrfs? ( sys-fs/btrfs-progs )
+ seccomp? ( sys-libs/libseccomp )"
+RDEPEND=">=app-emulation/runc-1.0.0_rc5
+ seccomp? ( sys-libs/libseccomp )"
+
+S=${WORKDIR}/${P}/src/${EGO_PN}
+
+RESTRICT="test"
+
+src_prepare() {
+ default
+ if [[ ${PV} != *9999* ]]; then
+ sed -i -e "s/git describe --match.*$/echo ${PV})/"\
+ -e "s/git rev-parse HEAD.*$/echo $CONTAINERD_COMMIT)/"\
+ -e "s/-s -w//" \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ local options=( $(usex btrfs "" "no_btrfs") $(usex cri "" "no_cri") $(usex seccomp "seccomp" "") $(usex apparmor "apparmor" "") )
+ export GOPATH="${WORKDIR}/${P}" # ${PWD}/vendor
+ LDFLAGS=$(usex hardened '-extldflags -fno-PIC' '') BUILDTAGS="${options[@]}" emake
+}
+
+src_install() {
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ dodir /var/lib/containerd
+ dobin bin/containerd{-shim,-stress,} bin/ctr
+}
diff --git a/app-emulation/containerd/files/containerd.initd b/app-emulation/containerd/files/containerd.initd
new file mode 100644
index 000000000000..3a02d494ad15
--- /dev/null
+++ b/app-emulation/containerd/files/containerd.initd
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="Containerd container runtime"
+command="/usr/bin/containerd"
+pidfile="${pidfile:-/run/${RC_SVCNAME}.pid}"
+start_stop_daemon_args="--background --stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log --stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
+
+start_pre() {
+ 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
+}