app-emulation/{containerd,docker}: separately managed containerd unit

This commit is contained in:
Joe Bowers 2016-09-29 17:12:36 -07:00
parent c5b074e019
commit 0de4f04368
5 changed files with 31 additions and 9 deletions

View File

@ -0,0 +1 @@
containerd-9999.ebuild

View File

@ -19,7 +19,7 @@ else
inherit vcs-snapshot inherit vcs-snapshot
fi fi
inherit coreos-go inherit coreos-go systemd
DESCRIPTION="A daemon to control runC" DESCRIPTION="A daemon to control runC"
HOMEPAGE="https://containerd.tools" HOMEPAGE="https://containerd.tools"
@ -39,4 +39,6 @@ src_compile() {
src_install() { src_install() {
dobin bin/containerd* bin/ctr dobin bin/containerd* bin/ctr
systemd_dounit "${FILESDIR}/containerd.service"
} }

View File

@ -0,0 +1,19 @@
[Unit]
Description=Containerd Container Daemon
Documentation=http://github.com/docker/containerd
[Service]
Type=simple
ExecStart=/usr/bin/containerd --listen unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim /usr/bin/containerd-shim --state-dir /var/run/docker/libcontainerd/containerd --runtime /usr/bin/runc
# (lack of) limits from the upstream docker service unit
LimitNOFILE=1048576
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
# set delegate yes so that systemd does not reset the cgroups of containers
Delegate=yes
[Install]
WantedBy=multi-user.target early-docker.target

View File

@ -1,17 +1,17 @@
[Unit] [Unit]
Description=Docker Application Container Engine Description=Docker Application Container Engine
Documentation=http://docs.docker.com Documentation=http://docs.docker.com
After=docker.socket early-docker.target network.target After=containerd.service docker.socket early-docker.target network.target
Requires=docker.socket early-docker.target Requires=containerd.service docker.socket early-docker.target
[Service] [Service]
Type=notify Type=notify
EnvironmentFile=-/run/flannel/flannel_docker_opts.env EnvironmentFile=-/run/flannel/flannel_docker_opts.env
MountFlags=slave
# the default is not to use systemd for cgroups because the delegate issues still # the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required # exists and systemd currently does not support the cgroup feature set required
# for containers run by docker # for containers run by docker
ExecStart=/usr/lib/coreos/dockerd --host=fd:// $DOCKER_OPTS $DOCKER_CGROUPS $DOCKER_OPT_BIP $DOCKER_OPT_MTU $DOCKER_OPT_IPMASQ ExecStart=/usr/lib/coreos/dockerd --host=fd:// --containerd=/var/run/docker/libcontainerd/docker-containerd.sock $DOCKER_OPTS $DOCKER_CGROUPS $DOCKER_OPT_BIP $DOCKER_OPT_MTU $DOCKER_OPT_IPMASQ
ExecReload=/bin/kill -s HUP $MAINPID ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576 LimitNOFILE=1048576
# Having non-zero Limit*s causes performance problems due to accounting overhead # Having non-zero Limit*s causes performance problems due to accounting overhead

View File

@ -1,17 +1,17 @@
[Unit] [Unit]
Description=Early Docker Application Container Engine Description=Early Docker Application Container Engine
Documentation=http://docs.docker.com Documentation=http://docs.docker.com
After=early-docker.socket After=containerd.service early-docker.socket
Requires=early-docker.socket Requires=containerd.service early-docker.socket
[Service] [Service]
Type=notify Type=notify
Environment=TMPDIR=/var/tmp Environment=TMPDIR=/var/tmp
MountFlags=slave
# the default is not to use systemd for cgroups because the delegate issues still # the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required # exists and systemd currently does not support the cgroup feature set required
# for containers run by docker # for containers run by docker
ExecStart=/usr/lib/coreos/dockerd --host=fd:// --bridge=none --iptables=false --ip-masq=false --exec-root=/var/run/early-docker --graph=/var/lib/early-docker --pidfile=/var/run/early-docker.pid $DOCKER_OPTS $DOCKER_CGROUPS ExecStart=/usr/lib/coreos/dockerd --host=fd:// --bridge=none --iptables=false --ip-masq=false --exec-root=/var/run/early-docker --graph=/var/lib/early-docker --pidfile=/var/run/early-docker.pid --containerd=/var/run/docker/libcontainerd/docker-containerd.sock $DOCKER_OPTS $DOCKER_CGROUPS
ExecReload=/bin/kill -s HUP $MAINPID ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576 LimitNOFILE=1048576
# Having non-zero Limit*s causes performance problems due to accounting overhead # Having non-zero Limit*s causes performance problems due to accounting overhead