do
build $label
done
+
+alpine-dom0/dom0-containers/build.sh
+
do
docker rmi -f $label
done
+docker rmi -f dom0
+docker rmi -f kernel
--- /dev/null
+#!/bin/sh
+
+# For Zededa components we assume LinuxKit
+
+label="kernel"
+linuxkit pkg build --disable-content-trust -hash $label alpine-dom0/dom0-containers/$label/
+
+label="zededa-builder"
+linuxkit pkg build --disable-content-trust -hash $label alpine-dom0/dom0-containers/$label/
+
+if ! test -f out/rootfs.tar
+then
+ mkdir -p out/ &>/dev/null
+ moby build -o out/rootfs.tar alpine-dom0/dom0-containers/rootfs.template
+fi
+
+label="dom0"
+mv out/rootfs.tar alpine-dom0/dom0-containers/"$label"
+linuxkit pkg build --disable-content-trust -hash $label alpine-dom0/dom0-containers/$label/
+mv alpine-dom0/dom0-containers/"$label"/rootfs.tar out/
--- /dev/null
+FROM scratch as dom0
+
+ADD rootfs.tar /
+
--- /dev/null
+image: dom0
+org: mojoos
+network: yes
--- /dev/null
+FROM scratch as kernel
+
+COPY --from=mojoos/linux-builder:linux-builder /out/boot /boot
+
--- /dev/null
+image: kernel
+org: mojoos
+network: yes
--- /dev/null
+kernel:
+ cmdline: "root=/dev/sdb2 rootwait"
+init:
+ - mojoos/kernel:kernel
+ - mojoos/dom0-ztools-builder:dom0-ztools-builder
+ - linuxkit/init:7804129bd06218b72c298139a25698a748d253c6
+ - linuxkit/runc:a1b564248a0d0b118c11e61db9f84ecf41dd2d2a
+ - linuxkit/containerd:417f83f7b8dc1fa36acf90effe44f99c7397480a
+ - linuxkit/getty:bf6872ce0a9f3ab519b3e502cc41ba3958bda2a6
+onboot:
+ - name: dhcpcd
+ image: linuxkit/dhcpcd:d4408777ed6b6e6e562a5d4938fd09804324b33e
+ command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
+services:
+ - name: zededa-tools
+ image: mojoos/zededa-builder:zededa-builder
+ binds:
+ - /dev:/dev
+ - /etc/resolv.conf:/etc/resolv.conf
+ net: host
+ capabilities:
+ - all
+trust:
+ org:
+ - linuxkit
--- /dev/null
+FROM alpine:3.6 as zededa-builder
+
+RUN apk add --no-cache \
+ yajl xz bash openssl iptables ip6tables \
+ coreutils dmidecode sudo libbz2 libuuid ipset curl glib pixman \
+ libattr libpcap libaio pixman glib wget radvd perl ethtool openssh-server
+
+# The following enables pcappy to dlopen libpcap.so
+RUN ln -s libpcap.so.1 /usr/lib/libpcap.so
+
+# FIXME: we really need to do a proper linuxkit sshd
+RUN ssh-keygen -A ; echo PermitRootLogin yes >> /etc/ssh/sshd_config ; sed -ie '/^root/s#^.*$#root:$6$Ndt1G5AYZFQ8rz7m$7vGZMKKotSYxwxk/.jMfuOCzxw0I3DNedygaQaLF7kYSYsLqiBHhmc8RJSXp8/VxSYPpgYSz/8fkv0hO6I4js.:17477:0:::::#' /etc/shadow
+
+COPY --from=mojoos/test-cert:test-cert /out /
+
+RUN mkdir -p /opt/zededa/bin/dnsmasq && \
+mv /usr/sbin/dnsmasq /opt/zededa/bin/dnsmasq && \
+rm -rf /boot
+
+# And now a few local tweaks
+COPY rootfs/ /
+
+# FIXME: replace with tini+monit ASAP
+CMD /init.sh
--- /dev/null
+image: zededa-builder
+org: mojoos
+network: yes
--- /dev/null
+hosts: files dns
--- /dev/null
+#!/bin/sh
+#
+# This *really* needs to be replaced with tini+monit ASAP.
+
+# Need to disable H/W TCP offload since it seems to mess us up
+ethtool -K eth0 gro off
+ethtool -K eth1 gro off
+
+# For convenice's sake we're putting SSH inisde of a root container
+/usr/sbin/sshd
+
+# Finally, we need to start Xen
+XENCONSOLED_ARGS='--log=all --log-dir=/var/log/xen' /etc/init.d/xencommons start
+
+# This is an optional component - only run it if it is there
+/opt/zededa/bin/device-steps.sh -w < /opt/zededa/etc/cert-input.txt || :
+
+tail -f /var/log/*
dnsmasq-builder
test-cert
dom0-ztools-builder
-dom0