mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 09:16:29 +00:00
update init for containers for recent changes
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
680fafd705
commit
0e65f04ab4
@ -11,5 +11,8 @@ tag: $(DEPS)
|
||||
docker build --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
|
||||
|
||||
push: tag
|
||||
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
|
||||
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)
|
||||
docker pull $(ORG)/$(IMAGE):$(HASH) || \
|
||||
docker push $(ORG)/$(IMAGE):$(HASH)
|
||||
|
||||
forcepush: tag
|
||||
docker push $(ORG)/$(IMAGE):$(HASH)
|
||||
|
@ -1,10 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# execute other init processes
|
||||
INITS="$(find /etc/init.d -type f | sort)"
|
||||
INITS="$(find /etc/init.d ! -type d 2>/dev/null | sort)"
|
||||
for f in $INITS
|
||||
do
|
||||
$f &
|
||||
$f
|
||||
done
|
||||
|
||||
wait
|
||||
# wait forever to keep container open
|
||||
while true; do sleep 2147483647; done
|
||||
|
12
pkg/init-container/etc/init.d/000-issue
Executable file
12
pkg/init-container/etc/init.d/000-issue
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f /etc/issue ]; then
|
||||
for opt in $(cat /proc/cmdline); do
|
||||
case "$opt" in
|
||||
console=*)
|
||||
fulltty=${opt#console=}
|
||||
tty=${fulltty%,*}
|
||||
cat /etc/issue >> /dev/$tty
|
||||
esac
|
||||
done
|
||||
fi
|
@ -1,46 +0,0 @@
|
||||
#!/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 &
|
||||
|
||||
# wait for socket to be there
|
||||
while [ ! -S /run/containerd/containerd.sock ]
|
||||
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 ]
|
||||
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
|
12
pkg/init-container/etc/issue
Normal file
12
pkg/init-container/etc/issue
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
Welcome to LinuxKit
|
||||
|
||||
## .
|
||||
## ## ## ==
|
||||
## ## ## ## ## ===
|
||||
/"""""""""""""""""\___/ ===
|
||||
{ / ===-
|
||||
\______ O __/
|
||||
\ \ __/
|
||||
\____\_______/
|
||||
|
Loading…
Reference in New Issue
Block a user