mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-08-03 16:00:36 +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
|
IMAGE=containerd
|
||||||
NETWORK=1
|
NETWORK=1
|
||||||
DEPS=$(wildcard etc/init.d/*)
|
DEPS=$(wildcard etc/init.d/*) etc/containerd/config.toml
|
||||||
|
|
||||||
include ../package.mk
|
include ../package.mk
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# set global ulimits TODO move to /etc/limits.conf
|
|
||||||
ulimit -n 1048576
|
|
||||||
ulimit -p unlimited
|
|
||||||
|
|
||||||
# bring up containerd
|
# bring up containerd
|
||||||
printf "\nStarting containerd\n"
|
printf "\nStarting containerd\n"
|
||||||
/usr/bin/containerd &
|
/usr/bin/containerd &
|
||||||
@ -14,20 +10,6 @@ do
|
|||||||
sleep 0.1
|
sleep 0.1
|
||||||
done
|
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
|
# start service containers
|
||||||
|
|
||||||
if [ -d /containers/services ]
|
if [ -d /containers/services ]
|
@ -114,6 +114,10 @@ mount --make-rshared /var
|
|||||||
# make / rshared
|
# make / rshared
|
||||||
mount --make-rshared /
|
mount --make-rshared /
|
||||||
|
|
||||||
|
# set global ulimits TODO move to /etc/limits.conf?
|
||||||
|
ulimit -n 1048576
|
||||||
|
ulimit -p unlimited
|
||||||
|
|
||||||
# execute other init processes
|
# execute other init processes
|
||||||
INITS="$(find /etc/init.d -type f | sort)"
|
INITS="$(find /etc/init.d -type f | sort)"
|
||||||
for f in $INITS
|
for f in $INITS
|
||||||
|
@ -25,3 +25,4 @@ FROM scratch
|
|||||||
WORKDIR /
|
WORKDIR /
|
||||||
ENTRYPOINT []
|
ENTRYPOINT []
|
||||||
COPY --from=alpine /usr/bin/runc /usr/bin/
|
COPY --from=alpine /usr/bin/runc /usr/bin/
|
||||||
|
COPY etc etc/
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
IMAGE=runc
|
IMAGE=runc
|
||||||
NETWORK=1
|
NETWORK=1
|
||||||
|
DEPS=$(wildcard etc/init.d/*)
|
||||||
|
|
||||||
include ../package.mk
|
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