mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-30 05:51:26 +00:00
Move onboot startup script to runc package
As this does not use containerd at all, this means you can run very minimal setups with just `runc` if you use no services, for example most of our tests do not actually use services, or if you have other similar very minimal use cases. Move ulimit setup to `init` which makes more sense. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
22be0a10bf
commit
28b4245b12
@ -1,5 +1,5 @@
|
||||
IMAGE=containerd
|
||||
NETWORK=1
|
||||
DEPS=$(wildcard etc/init.d/*)
|
||||
DEPS=$(wildcard etc/init.d/*) etc/containerd/config.toml
|
||||
|
||||
include ../package.mk
|
||||
|
@ -1,9 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
# set global ulimits TODO move to /etc/limits.conf
|
||||
ulimit -n 1048576
|
||||
ulimit -p unlimited
|
||||
|
||||
# bring up containerd
|
||||
printf "\nStarting containerd\n"
|
||||
/usr/bin/containerd &
|
||||
@ -14,20 +10,6 @@ do
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
# 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 ]
|
@ -114,6 +114,10 @@ mount --make-rshared /var
|
||||
# make / rshared
|
||||
mount --make-rshared /
|
||||
|
||||
# set global ulimits TODO move to /etc/limits.conf?
|
||||
ulimit -n 1048576
|
||||
ulimit -p unlimited
|
||||
|
||||
# execute other init processes
|
||||
INITS="$(find /etc/init.d -type f | sort)"
|
||||
for f in $INITS
|
||||
|
@ -25,3 +25,4 @@ FROM scratch
|
||||
WORKDIR /
|
||||
ENTRYPOINT []
|
||||
COPY --from=alpine /usr/bin/runc /usr/bin/
|
||||
COPY etc etc/
|
||||
|
@ -1,4 +1,5 @@
|
||||
IMAGE=runc
|
||||
NETWORK=1
|
||||
DEPS=$(wildcard etc/init.d/*)
|
||||
|
||||
include ../package.mk
|
||||
|
15
pkg/runc/etc/init.d/010-onboot
Executable file
15
pkg/runc/etc/init.d/010-onboot
Executable file
@ -0,0 +1,15 @@
|
||||
#!/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
|
Loading…
Reference in New Issue
Block a user