mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 09:16:29 +00:00
Merge pull request #141 from justincormack/update-docker
Update docker examples
This commit is contained in:
commit
7a549fda07
@ -1,9 +1,8 @@
|
||||
init:
|
||||
- mobytest/init-container:b5de246b2790d74d53bae583a95c87869ca003e6
|
||||
- linuxkit/runc:3a4e6cbf15470f62501b019b55e1caac5ee7689f
|
||||
- linuxkit/containerd:5749f2e9e65395cc6635229e8da0e0d484320ddf
|
||||
- linuxkit/ca-certificates:75cf419fb58770884c3464eb687ec8dfc704169d
|
||||
- mobytest/init-container:132e5ee824d41c70ade5fa10071f32170cb9561e
|
||||
- linuxkit/runc:dfc0437161843bc0dfeb334cda7ffd6a18b76bcd
|
||||
- linuxkit/containerd:d136569c66ce041853d762b7032456419e580efe
|
||||
- linuxkit/ca-certificates:e44b0a66df5a102c0e220f0066b0d904710dcb10
|
||||
trust:
|
||||
org:
|
||||
- linuxkit
|
||||
- mobytest
|
||||
|
@ -1,18 +1,18 @@
|
||||
kernel:
|
||||
image: "linuxkit/kernel:4.9.x"
|
||||
image: "linuxkit/kernel:4.9.41"
|
||||
cmdline: "console=ttyS0"
|
||||
init:
|
||||
- linuxkit/init:1b8a7e394d2ec2f1fdb4d67645829d1b5bdca037
|
||||
- linuxkit/runc:3a4e6cbf15470f62501b019b55e1caac5ee7689f
|
||||
- linuxkit/containerd:5749f2e9e65395cc6635229e8da0e0d484320ddf
|
||||
- linuxkit/ca-certificates:75cf419fb58770884c3464eb687ec8dfc704169d
|
||||
- linuxkit/init:c7d651da1a5e308c757bc61ce6a41804ea843426
|
||||
- linuxkit/runc:dfc0437161843bc0dfeb334cda7ffd6a18b76bcd
|
||||
- linuxkit/containerd:d136569c66ce041853d762b7032456419e580efe
|
||||
- linuxkit/ca-certificates:e44b0a66df5a102c0e220f0066b0d904710dcb10
|
||||
onboot:
|
||||
- name: dhcpcd
|
||||
image: "linuxkit/dhcpcd:7d2b8aaaf20c24ad7d11a5ea2ea5b4a80dc966f1"
|
||||
image: "linuxkit/dhcpcd:f3f5413abb78fae9020e35bd4788fa93df4530b7"
|
||||
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
|
||||
services:
|
||||
- name: rngd
|
||||
image: "linuxkit/rngd:1fa4de44c961bb5075647181891a3e7e7ba51c31"
|
||||
image: "linuxkit/rngd:558e86a36242bb74353bc9287b715ddb8567357e"
|
||||
trust:
|
||||
org:
|
||||
- linuxkit
|
||||
|
@ -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 __/
|
||||
\ \ __/
|
||||
\____\_______/
|
||||
|
@ -36,7 +36,6 @@ const dockerfile = `
|
||||
FROM scratch
|
||||
|
||||
COPY . ./
|
||||
RUN rm -f Dockerfile
|
||||
|
||||
ENTRYPOINT ["/sbin/tini", "--", "/bin/rc.init"]
|
||||
`
|
||||
|
Loading…
Reference in New Issue
Block a user