mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 09:16:29 +00:00
logging: update init scripts to latest version with containerd
Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
This commit is contained in:
parent
c4da8863fd
commit
4a9a5afd03
@ -1,9 +1,6 @@
|
||||
FROM alpine:3.5
|
||||
|
||||
RUN \
|
||||
apk --no-cache update && \
|
||||
apk --no-cache upgrade -a && \
|
||||
apk --no-cache add \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# Use sha256 here to get a fixed version
|
||||
FROM alpine:edge@sha256:99588bc8883c955c157d18fc3eaa4a3c1400c223e6c7cabca5f600a3e9f8d5cd
|
||||
ENTRYPOINT []
|
||||
CMD []
|
||||
WORKDIR /
|
||||
COPY . ./
|
||||
|
@ -1,38 +1,14 @@
|
||||
C_COMPILE=linuxkit/c-compile:63b085bbaec1aa7c42a7bd22a4b1c350d900617d@sha256:286e3a729c7a0b1a605ae150235416190f9f430c29b00e65fa50ff73158998e5
|
||||
START_STOP_DAEMON=sbin/start-stop-daemon
|
||||
|
||||
.PHONY: tag push
|
||||
default: push
|
||||
|
||||
$(START_STOP_DAEMON): start-stop-daemon.c
|
||||
mkdir -p $(dir $@)
|
||||
tar cf - $^ | docker run --rm --net=none --log-driver=none -i $(C_COMPILE) -o $@ | tar xf -
|
||||
|
||||
.PHONY: tag push
|
||||
|
||||
BASE=alpine:3.5
|
||||
IMAGE=init
|
||||
DEPS=Dockerfile init $(wildcard etc/*) $(wildcard etc/init.d/*)
|
||||
|
||||
ETC=$(shell find etc -type f)
|
||||
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
|
||||
|
||||
hash: Dockerfile $(ETC) init $(START_STOP_DAEMON)
|
||||
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
||||
docker run --rm $(IMAGE):build sh -c 'cat $^ /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > $@
|
||||
tag: $(DEPS)
|
||||
docker build --no-cache --network=none -t linuxkit/$(IMAGE):$(HASH) .
|
||||
|
||||
push: hash
|
||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
||||
(docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) && \
|
||||
docker push linuxkit/$(IMAGE):$(shell cat hash))
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
tag: hash
|
||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
||||
docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash)
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
clean:
|
||||
rm -rf hash sbin usr
|
||||
|
||||
.DELETE_ON_ERROR:
|
||||
push: tag
|
||||
docker pull linuxkit/$(IMAGE):$(HASH) || \
|
||||
docker push linuxkit/$(IMAGE):$(HASH)
|
||||
|
@ -1,9 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
# start memlogd container
|
||||
|
||||
/usr/bin/startmemlogd
|
||||
|
||||
# start onboot containers, run to completion
|
||||
|
||||
if [ -d /containers/onboot ]
|
||||
@ -13,7 +9,7 @@ then
|
||||
base="$(basename $f)"
|
||||
/bin/mount --bind "$f/rootfs" "$f/rootfs"
|
||||
mount -o remount,rw "$f/rootfs"
|
||||
/usr/bin/logwrite -n "$(basename $f)" /usr/bin/runc run --bundle "$f" "$(basename $f)"
|
||||
/usr/bin/runc run --bundle "$f" "$(basename $f)"
|
||||
printf " - $base\n"
|
||||
done
|
||||
fi
|
||||
@ -28,7 +24,7 @@ then
|
||||
/bin/mount --bind "$f/rootfs" "$f/rootfs"
|
||||
mount -o remount,rw "$f/rootfs"
|
||||
log="/var/log/$base.log"
|
||||
/usr/bin/logwrite -n "$(basename $f)" /sbin/start-stop-daemon --start --pidfile /run/$base.pid --exec /usr/bin/runc -- run --bundle "$f" --pid-file /run/$base.pid "$(basename $f)" </dev/null 2>$log >$log &
|
||||
ctr run --runtime-config "$f/config.json" --rootfs "$f/rootfs" --id "$(basename $f)" </dev/null 2>$log >$log &
|
||||
printf " - $base\n"
|
||||
done
|
||||
fi
|
||||
|
@ -1,8 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# mount filesystems
|
||||
mkdir -p -m 0755 /proc /run /tmp /sys /dev
|
||||
|
||||
mount -n -t proc proc /proc -o nodev,nosuid,noexec,relatime
|
||||
|
||||
mount -n -t tmpfs tmpfs /run -o nodev,nosuid,noexec,relatime,size=10%,mode=755
|
||||
@ -83,10 +81,10 @@ then
|
||||
hostname -F /etc/hostname
|
||||
fi
|
||||
|
||||
if [ $(hostname) = "moby" -a -f /sys/class/net/eth0/address ]
|
||||
if [ $(hostname) = "(none)" -a -f /sys/class/net/eth0/address ]
|
||||
then
|
||||
mac=$(cat /sys/class/net/eth0/address)
|
||||
hostname moby-$(echo $mac | sed 's/://g')
|
||||
hostname linuxkit-$(echo $mac | sed 's/://g')
|
||||
fi
|
||||
|
||||
# set system clock from hwclock
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user