Files
linuxkit/alpine/packages/containerd/etc/init.d/containerd
Justin Cormack bf1c21e045 Run rngd inside a system container
- this needs an init as it does not respond to stop signals, so include tini
- needs CAP_SYS_ADMIN to write to kernel entropy estimate
- set kernel.random.write_wakeup_threshold so that rngd does not need sysctl write access
- build patches from Alpine, but statically linked
- remove rngd from base image, means we no longer need community repository

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-12-02 14:00:12 +00:00

37 lines
623 B
Plaintext
Executable File

#!/sbin/openrc-run
depend()
{
before docker
}
start()
{
ebegin "Running system containerd"
# set ulimits as high as possible
ulimit -n 1048576
ulimit -p unlimited
/usr/bin/containerd 1>&2 2>/var/log/containerd.log &
ewaitfile 5 /var/run/containerd/containerd.sock
eend $? "Failed to start system containerd"
ebegin "Running system containers"
LOG=/var/log/system-containers.log
touch $LOG
for f in /containers/*
do
containerd-ctr containers start --no-pivot --attach "$(basename $f)" "$f" 2>$LOG >$LOG &
printf " $(basename $f)"
done
printf "\n"
eend $? "Failed to start system containers"
}