mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-10-28 04:38:27 +00:00
Because we are not yet using the image store, this requires a patched `ctr` that can run a specified rootfs rather than an image. We will switch to the image store later, but this requires extensive build changes. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
33 lines
765 B
Bash
Executable File
33 lines
765 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
|
|
|
|
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"
|
|
ctr run --runtime-config "$f/config.json" --rootfs "$f/rootfs" --id "$(basename $f)" </dev/null 2>$log >$log &
|
|
printf " - $base\n"
|
|
done
|
|
fi
|
|
|
|
wait
|