app-containers/containerd: new package, add 2.0.0

Signed-off-by: Federico Justus Denkena <federico.denkena@posteo.de>
This commit is contained in:
Federico Justus Denkena 2024-12-08 16:00:58 +01:00
parent 1142e0ae53
commit 0798e66ed3
Signed by: f-denkena
GPG Key ID: 28F91C66EE36F382
5 changed files with 151 additions and 0 deletions

View File

@ -0,0 +1,5 @@
AUX containerd.confd 125 BLAKE2B 95cc4fe7a47c01d56220382f9ee426ff6b1c0727d8664f6e828fd409ea9b4662f7deb76054f0ca05f760c032e6cbe02835b6deb45d121dab60a18fcdf79c3f2d SHA512 f0c70734bd0eefb35f27d1635c616455cacdab1c21c57f680007edc561e29d0b60881ad4c6deb7fd85d57ef8a13bca13381595c7ce9aceae4dd43d14dc7250cf
AUX containerd.initd 795 BLAKE2B 63414ba2ee08856e981fcb02adddc3f6fec69222b3b49de5b8b5962ae70e0e9f3973020d201ed6c43d295c1a4dd88e61831c6f4a5b647bae19ede4307d9271a7 SHA512 d79675948164886164c7c5e312f97aa355a576353c48ed0b61b01e1cfbe16180318f6b332f64a5256da35e01c34f980961858a56ff40b8420f10a627e142454a
DIST containerd-2.0.0.tar.gz 10420188 BLAKE2B 4a75c845cabf3e0213a7cd312febc0c45b127b5b70caa5b6843e669b554e4fa65112585f3b16382180539527144d2371f02bc791cb01415eb60ad01d17f0065a SHA512 b1a89c4c53db2c69757bc40d90d585e2662ab4fffb28acb904f9710b281a9f22273ecdbab49250b229bf95b29cf1a33a352afb81967db7580ae209a83c5fb2ea
EBUILD containerd-2.0.0.ebuild 2021 BLAKE2B fd8450c31bf9028f0af2e923821f3ded275727a8c41b86ff067ed08d9d014556609f193a74b957efcd053d6ed43c88a71ae40b45fff6b97560b89fdc78a2089e SHA512 ff57c3619355b5354e44261647552b7472342a96b673d95c928c6af034b33e66ef3824c04dc38ba8811f9f9ce39dc4d7ed40a223846b2cfcb26877ebc9484c52
MISC metadata.xml 982 BLAKE2B 10929604b4ee30f20795306eb1a963f6d03cea841206cb63612b9f0b987a7851d99ebbd91cec4849907d6f21b50a93296dfd843f2cc3fc1c4a9054cb45fbd3f5 SHA512 09530758c2ba3871cea867636a3b88f0d70491782391e20354cab2cb0eb739190729684037654def63c7aa0dd3a7d79cd0435cdb0a5e20f3bdd497c956d84470

View File

@ -0,0 +1,90 @@
# Copyright 2022-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module systemd
GIT_REVISION=57f17b0a6295a39009d861b89e3b3b87b005ca27
DESCRIPTION="A daemon to control runC"
HOMEPAGE="https://containerd.io/"
SRC_URI="https://github.com/containerd/containerd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
IUSE="apparmor btrfs device-mapper +cri hardened +seccomp selinux test"
COMMON_DEPEND="
btrfs? ( sys-fs/btrfs-progs )
seccomp? ( sys-libs/libseccomp )
"
DEPEND="
${COMMON_DEPEND}
"
# recommended version of runc is found in script/setup/runc-version
RDEPEND="
${COMMON_DEPEND}
~app-containers/runc-1.2.2[apparmor?,seccomp?]
"
BDEPEND="
dev-go/go-md2man
virtual/pkgconfig
"
# tests require root or docker
RESTRICT+="test"
src_prepare() {
default
sed -i \
-e "s/-s -w//" \
-e "s/-mod=readonly//" \
Makefile || die
sed -i \
-e "s:/usr/local:/usr:" \
containerd.service || die
}
src_compile() {
local options=(
$(usev apparmor)
$(usex btrfs "" "no_btrfs")
$(usex cri "" "no_cri")
$(usex device-mapper "" "no_devmapper")
$(usev seccomp)
$(usev selinux)
)
myemakeargs=(
BUILDTAGS="${options[*]}"
LDFLAGS="$(usex hardened '-extldflags -fno-PIC' '')"
REVISION="${GIT_REVISION}"
VERSION=v${PV}
)
# race condition in man target https://bugs.gentoo.org/765100
# we need to explicitly specify GOFLAGS for "go run" to use vendor source
emake "${myemakeargs[@]}" man -j1 #nowarn
emake "${myemakeargs[@]}" all
}
src_install() {
rm bin/gen-manpages || die
dobin bin/*
doman man/*
newconfd "${FILESDIR}"/${PN}.confd "${PN}"
newinitd "${FILESDIR}"/${PN}.initd "${PN}"
systemd_dounit containerd.service
keepdir /var/lib/containerd
# we already installed manpages, remove markdown source
# before installing docs directory
rm -r docs/man || die
local DOCS=( ADOPTERS.md README.md RELEASES.md ROADMAP.md SCOPE.md docs/. )
einstalldocs
}

View File

@ -0,0 +1,4 @@
# This is the delay to be used in the start_post function to wait for
# the socket to be active.
#containerd_socket_delay=5

View File

@ -0,0 +1,27 @@
#!/sbin/openrc-run
# Copyright 1999-2024 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
}

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<longdescription>
Containerd is a daemon with an API and a command line client, to manage
containers on one machine. It uses runC to run containers according to
the OCI specification. Containerd has advanced features such as seccomp
and user namespace support as well as checkpoint and restore for cloning
and live migration of containers.
</longdescription>
<maintainer type="person">
<email>williamh@gentoo.org</email>
<name>William Hubbs</name>
</maintainer>
<use>
<flag name="btrfs">Support for BTRFS snapshot driver</flag>
<flag name="cri">Support for Kubernetes CRI</flag>
<flag name="device-mapper">Support for device mapper snapshot driver</flag>
</use>
<upstream>
<remote-id type="github">containerd/containerd</remote-id>
<remote-id type="cpe">cpe:/a:linuxfoundation:containerd</remote-id>
</upstream>
</pkgmetadata>