Switch runc and containerd startup to be entirely Go

At present they use a small shared function called "prepare"
that does the read-write remounts, that I will switch to doing overlay
mounts soon.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack
2017-07-26 16:16:25 +01:00
parent 5194bf13d1
commit cb2ca4ef66
14 changed files with 128 additions and 56 deletions

View File

@@ -99,7 +99,7 @@ ip route add 127.0.0.0/8 dev lo scope host
ip link set lo up
# for containerizing dhcpcd and other containers that need writable /etc/resolv.conf
[ -L /etc/resolv.conf ] && mkdir -p $(dirname $(readlink -n /etc/resolv.conf))
[ -L /etc/resolv.conf ] && mkdir -p $(dirname $(readlink -n /etc/resolv.conf)) && touch /etc/resolv.conf
# remount rootfs as readonly
mount -o remount,ro /
@@ -117,7 +117,7 @@ ulimit -n 1048576
ulimit -p unlimited
# execute other init processes
INITS="$(find /etc/init.d -type f 2>/dev/null | sort)"
INITS="$(find /etc/init.d ! -type d 2>/dev/null | sort)"
for f in $INITS
do
$f

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# execute other shutdown processes
SHUTS="$(find /etc/shutdown.d -type f 2>/dev/null | sort)"
SHUTS="$(find /etc/shutdown.d ! -type d 2>/dev/null | sort)"
for f in $SHUTS
do
$f