mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 09:16:29 +00:00
Remove LCOW
It is now under https://github.com/linuxkit/lcow Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
9e65b8b4c3
commit
32fca2954f
@ -45,12 +45,5 @@ CONTAINER ID IMAGE COMMAND CREATED
|
|||||||
|
|
||||||
### Linux Containers On Windows (LCOW)
|
### Linux Containers On Windows (LCOW)
|
||||||
|
|
||||||
The [LCOW](./lcow.yml) file contains the blueprint for building a
|
The LCOW blueprint has moved to [its own
|
||||||
minimal Linux kernel and initrd for Linux Containers on
|
repository](https://github.com/linuxkit/lcow).
|
||||||
Windows. Invoke it with `moby build lcow.yml` and you get a
|
|
||||||
`lcow-kernel` and `lcow-initrd.img`. Rename `lcow-kernel` to
|
|
||||||
`bootx64.efi` and `lcow-initrd.img` to `initrd.img` and then
|
|
||||||
follow
|
|
||||||
[these instructions](https://github.com/moby/moby/issues/33850). The
|
|
||||||
process for creating the image is
|
|
||||||
documented [here](https://github.com/Microsoft/opengcs).
|
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
kernel:
|
|
||||||
# XXX Use the content hash as there are several 4.12.14 images on hub
|
|
||||||
image: linuxkit/kernel:4.12.14-c4d19a4de21def5a5134a6f70ef7212c31104bf1
|
|
||||||
cmdline: "console=ttyS0"
|
|
||||||
tar: none
|
|
||||||
init:
|
|
||||||
- linuxkit/init-lcow:f18287f91bf996fd931c3b59b538048653cd4f5f
|
|
||||||
- linuxkit/runc:1b0741d07949c0acc444cd6a04ee7f833443579d
|
|
||||||
files:
|
|
||||||
- path: etc/linuxkit.yml
|
|
||||||
metadata: yaml
|
|
||||||
trust:
|
|
||||||
org:
|
|
||||||
- linuxkit
|
|
@ -1,32 +0,0 @@
|
|||||||
FROM linuxkit/alpine:7d79062909882186e881aad263668d66e6df2a28 AS mirror
|
|
||||||
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
|
|
||||||
RUN apk add --no-cache --initdb -p /out \
|
|
||||||
alpine-baselayout \
|
|
||||||
busybox \
|
|
||||||
e2fsprogs \
|
|
||||||
musl
|
|
||||||
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
|
|
||||||
|
|
||||||
FROM linuxkit/alpine:7d79062909882186e881aad263668d66e6df2a28 AS build
|
|
||||||
ENV OPENGCS_REPO=https://github.com/Microsoft/opengcs
|
|
||||||
ENV OPENGCS_COMMIT=2a3a94cca366171f159399ffbd1333058e1cef53
|
|
||||||
RUN apk add --no-cache build-base curl git go musl-dev
|
|
||||||
ENV GOPATH=/go PATH=$PATH:/go/bin
|
|
||||||
RUN git clone $OPENGCS_REPO /go/src/github.com/Microsoft/opengcs && \
|
|
||||||
cd /go/src/github.com/Microsoft/opengcs && \
|
|
||||||
git checkout $OPENGCS_COMMIT && \
|
|
||||||
cd service && \
|
|
||||||
make
|
|
||||||
RUN mkdir /out && \
|
|
||||||
cp -r /go/src/github.com/Microsoft/opengcs/service/bin /out/bin && \
|
|
||||||
mkdir /out/sbin && \
|
|
||||||
curl -fSL "https://raw.githubusercontent.com/mirror/busybox/38d966943f5288bb1f2e7219f50a92753c730b14/examples/udhcp/simple.script" -o /out/sbin/udhcpc_config.script && \
|
|
||||||
chmod ugo+rx /out/sbin/udhcpc_config.script
|
|
||||||
|
|
||||||
FROM scratch
|
|
||||||
ENTRYPOINT []
|
|
||||||
CMD []
|
|
||||||
WORKDIR /
|
|
||||||
COPY --from=mirror /out/ /
|
|
||||||
COPY --from=build /out/ /
|
|
||||||
COPY init /
|
|
@ -1,4 +0,0 @@
|
|||||||
image: init-lcow
|
|
||||||
network: true
|
|
||||||
arches:
|
|
||||||
- amd64
|
|
@ -1,63 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
export PATH=/sbin:/bin/:/usr/sbin/:/usr/bin/:/usr/local/sbin:/usr/local/bin
|
|
||||||
|
|
||||||
# Set up mounts
|
|
||||||
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
|
|
||||||
mount -n -t tmpfs tmpfs /tmp -o nodev,nosuid,noexec,relatime,size=10%,mode=1777
|
|
||||||
|
|
||||||
# mount devfs
|
|
||||||
mount -n -t devtmpfs dev /dev -o nosuid,noexec,relatime,size=10m,nr_inodes=248418,mode=755
|
|
||||||
# devices
|
|
||||||
[ -c /dev/console ] || mknod -m 600 /dev/console c 5 1
|
|
||||||
[ -c /dev/tty1 ] || mknod -m 620 /dev/tty1 c 4 1
|
|
||||||
[ -c /dev/tty ] || mknod -m 666 /dev/tty c 5 0
|
|
||||||
|
|
||||||
[ -c /dev/null ] || mknod -m 666 /dev/null c 1 3
|
|
||||||
[ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
|
|
||||||
|
|
||||||
# extra symbolic links not provided by default
|
|
||||||
[ -e /dev/fd ] || ln -snf /proc/self/fd /dev/fd
|
|
||||||
[ -e /dev/stdin ] || ln -snf /proc/self/fd/0 /dev/stdin
|
|
||||||
[ -e /dev/stdout ] || ln -snf /proc/self/fd/1 /dev/stdout
|
|
||||||
[ -e /dev/stderr ] || ln -snf /proc/self/fd/2 /dev/stderr
|
|
||||||
[ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
|
|
||||||
|
|
||||||
# devfs filesystems
|
|
||||||
mkdir -p -m 1777 /dev/mqueue
|
|
||||||
mkdir -p -m 1777 /dev/shm
|
|
||||||
mkdir -p -m 0755 /dev/pts
|
|
||||||
mount -n -t mqueue -o noexec,nosuid,nodev mqueue /dev/mqueue
|
|
||||||
mount -n -t tmpfs -o noexec,nosuid,nodev,mode=1777 shm /dev/shm
|
|
||||||
mount -n -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts
|
|
||||||
|
|
||||||
# mount sysfs
|
|
||||||
sysfs_opts=nodev,noexec,nosuid
|
|
||||||
mount -n -t sysfs -o ${sysfs_opts} sysfs /sys
|
|
||||||
[ -d /sys/kernel/security ] && mount -n -t securityfs -o ${sysfs_opts} securityfs /sys/kernel/security
|
|
||||||
[ -d /sys/kernel/debug ] && mount -n -t debugfs -o ${sysfs_opts} debugfs /sys/kernel/debug
|
|
||||||
[ -d /sys/kernel/config ] && mount -n -t configfs -o ${sysfs_opts} configfs /sys/kernel/config
|
|
||||||
[ -d /sys/fs/fuse/connections ] && mount -n -t fusectl -o ${sysfs_opts} fusectl /sys/fs/fuse/connections
|
|
||||||
[ -d /sys/fs/selinux ] && mount -n -t selinuxfs -o nosuid,noexec selinuxfs /sys/fs/selinux
|
|
||||||
[ -d /sys/fs/pstore ] && mount -n -t pstore pstore -o ${sysfs_opts} /sys/fs/pstore
|
|
||||||
[ -d /sys/firmware/efi/efivars ] && mount -n -t efivarfs -o ro,${sysfs_opts} efivarfs /sys/firmware/efi/efivars
|
|
||||||
|
|
||||||
# mount cgroups
|
|
||||||
mount -n -t tmpfs -o nodev,noexec,nosuid,mode=755,size=10m cgroup_root /sys/fs/cgroup
|
|
||||||
|
|
||||||
while read name hier groups enabled rest
|
|
||||||
do
|
|
||||||
case "${enabled}" in
|
|
||||||
1) mkdir -p /sys/fs/cgroup/${name}
|
|
||||||
mount -n -t cgroup -o ${sysfs_opts},${name} ${name} /sys/fs/cgroup/${name}
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done < /proc/cgroups
|
|
||||||
|
|
||||||
# Run gcs in the background
|
|
||||||
/bin/gcs -loglevel=debug -logfile=/tmp/gcs.log &
|
|
||||||
|
|
||||||
# Start shell so we can have access for debug
|
|
||||||
sh
|
|
@ -1,58 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
|
|
||||||
|
|
||||||
RESOLV_CONF="/etc/resolv.conf"
|
|
||||||
|
|
||||||
[ -n "$1" ] || { echo "Error: should be called from udhcpc"; exit 1; }
|
|
||||||
|
|
||||||
NETMASK=""
|
|
||||||
[ -n "$subnet" ] && NETMASK="netmask $subnet"
|
|
||||||
BROADCAST="broadcast +"
|
|
||||||
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
deconfig)
|
|
||||||
echo "Setting IP address 0.0.0.0 on $interface"
|
|
||||||
ifconfig $interface 0.0.0.0
|
|
||||||
;;
|
|
||||||
|
|
||||||
renew|bound)
|
|
||||||
echo "Setting IP address $ip on $interface"
|
|
||||||
ifconfig $interface $ip $NETMASK $BROADCAST
|
|
||||||
|
|
||||||
if [ -n "$router" ] ; then
|
|
||||||
echo "Deleting routers"
|
|
||||||
while route del default gw 0.0.0.0 dev $interface ; do
|
|
||||||
:
|
|
||||||
done
|
|
||||||
|
|
||||||
metric=0
|
|
||||||
for i in $router ; do
|
|
||||||
echo "Adding router $i"
|
|
||||||
if [ "$subnet" = "255.255.255.255" ]; then
|
|
||||||
# special case for /32 subnets:
|
|
||||||
# /32 instructs kernel to always use routing for all outgoing packets
|
|
||||||
# (they can never be sent to local subnet - there is no local subnet for /32).
|
|
||||||
# Used in datacenters, avoids the need for private ip-addresses between two hops.
|
|
||||||
ip route add $i dev $interface
|
|
||||||
fi
|
|
||||||
route add default gw $i dev $interface metric $((metric++))
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Recreating $RESOLV_CONF"
|
|
||||||
# If the file is a symlink somewhere (like /etc/resolv.conf
|
|
||||||
# pointing to /run/resolv.conf), make sure things work.
|
|
||||||
realconf=$(readlink -f "$RESOLV_CONF" 2>/dev/null || echo "$RESOLV_CONF")
|
|
||||||
tmpfile="$realconf-$$"
|
|
||||||
> "$tmpfile"
|
|
||||||
[ -n "$domain" ] && echo "search $domain" >> "$tmpfile"
|
|
||||||
for i in $dns ; do
|
|
||||||
echo " Adding DNS server $i"
|
|
||||||
echo "nameserver $i" >> "$tmpfile"
|
|
||||||
done
|
|
||||||
mv "$tmpfile" "$realconf"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
@ -1,26 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# SUMMARY: Test the build of LCOW blueprint
|
|
||||||
# LABELS:
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Source libraries. Uncomment if needed/defined
|
|
||||||
#. "${RT_LIB}"
|
|
||||||
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
|
|
||||||
|
|
||||||
NAME=lcow
|
|
||||||
|
|
||||||
clean_up() {
|
|
||||||
rm -f ${NAME}-*
|
|
||||||
}
|
|
||||||
|
|
||||||
trap clean_up EXIT
|
|
||||||
|
|
||||||
# Test code goes here
|
|
||||||
moby build -format kernel+initrd -name "${NAME}" "${LINUXKIT_BLUEPRINTS_DIR}/lcow.yml"
|
|
||||||
[ -f "${NAME}-kernel" ] || exit 1
|
|
||||||
[ -f "${NAME}-initrd.img" ] || exit 1
|
|
||||||
[ -f "${NAME}-cmdline" ] || exit 1
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user