mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-11-03 18:46:21 +00:00
Instead of mounting a new filesystem, revert to doing a `rw` bind. However do not make `/` `rshared`, just `/var` as that is where we expect filesystems to be mounted for persistence. Also only make the actual container rootfs writeable, not the whole directory. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
34 lines
862 B
Bash
Executable File
34 lines
862 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# start onboot containers, run to completion
|
|
|
|
if [ -d /containers/onboot ]
|
|
then
|
|
for f in $(find /containers/onboot -mindepth 1 -maxdepth 1 | sort)
|
|
do
|
|
base="$(basename $f)"
|
|
/bin/mount --bind "$f/rootfs" "$f/rootfs"
|
|
mount -o remount,rw "$f/rootfs"
|
|
/usr/bin/runc run --bundle "$f" "$(basename $f)"
|
|
printf " - $base\n"
|
|
done
|
|
fi
|
|
|
|
# start service containers
|
|
# temporarily using runc not containerd
|
|
|
|
if [ -d /containers/services ]
|
|
then
|
|
for f in $(find /containers/services -mindepth 1 -maxdepth 1 | sort)
|
|
do
|
|
base="$(basename $f)"
|
|
/bin/mount --bind "$f/rootfs" "$f/rootfs"
|
|
mount -o remount,rw "$f/rootfs"
|
|
log="/var/log/$base.log"
|
|
/sbin/start-stop-daemon --start --pidfile /run/$base.pid --exec /usr/bin/runc -- run --bundle "$f" --pid-file /run/$base.pid "$(basename $f)" </dev/null 2>$log >$log &
|
|
printf " - $base\n"
|
|
done
|
|
fi
|
|
|
|
wait
|