# This is an example for building the open source components of Docker for Mac kernel: image: linuxkit/kernel:5.10.104 cmdline: "console=ttyS0 page_poison=1" init: - linuxkit/vpnkit-expose-port:c61565ee34e58823aaf7c05fd6359a8fd889137f # install vpnkit-expose-port and vpnkit-iptables-wrapper on host - linuxkit/init:07d37c3ae7fad5ddcb54c8dc65774ae050851f04 - linuxkit/runc:2aabf16bc8a1b94e015ee53fa2e7a77ab1883a80 - linuxkit/containerd:95d5f0d2d8dc63bd87e96b7b39cf026cb86125c9 - linuxkit/ca-certificates:4de36e93dc87f7ccebd20db616ed10d381911d32 onboot: # support metadata for optional config in /run/config - name: metadata image: linuxkit/metadata:501144d47215671e77b9cac44748a04f21236195 - name: sysctl image: linuxkit/sysctl:c6f23919b8610c7645a89a89f863c6209bc84bee - name: sysfs image: linuxkit/sysfs:5fd982d39ff7bec8e480c67a110acb2d3794c291 - name: binfmt image: linuxkit/binfmt:af88a591f9cc896a52ce596b9cf7ca26a061ef97 # Format and mount the disk image in /var/lib/docker - name: format image: linuxkit/format:5161fe240e5824da04d51bcf5e00afcb0c18dc25 - name: mount image: linuxkit/mount:f671cb94a8999a65e33b3fe79f3def58e3d58b07 command: ["/usr/bin/mountie", "/var/lib"] # make a swap file on the mounted disk - name: swap image: linuxkit/swap:d17a7f1c26ff768c26b3c206ccf3aa72349568df command: ["/swap.sh", "--path", "/var/lib/swap", "--size", "1024M"] # mount-vpnkit mounts the 9p share used by vpnkit to coordinate port forwarding - name: mount-vpnkit image: alpine:3.13 binds: - /var/:/host_var:rbind,rshared capabilities: - CAP_SYS_ADMIN rootfsPropagation: shared command: ["sh", "-c", "mkdir -p /host_var/vpnkit/port && mount -v -t 9p -o trans=virtio,dfltuid=1001,dfltgid=50,version=9p2000 port /host_var/vpnkit"] # move logs to the mounted disk (this is a temporary fix until we can limit the log sizes) - name: move-logs image: alpine:3.13 binds: - /var:/host_var command: ["sh", "-c", "mv -v /host_var/log /host_var/lib && ln -vs /var/lib/log /host_var/log"] - name: dhcpcd image: linuxkit/dhcpcd:2a8ed08fea442909ba10f950d458191ed3647115 command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"] services: # Enable acpi to shutdown on power events - name: acpid image: linuxkit/acpid:548f8f1c8bda31cdbefb65bdb0747f97c17639d2 # Enable getty for easier debugging - name: getty image: linuxkit/getty:e74e6cad132403d1a6d6cd25b136a7c69c99f3f7 env: - INSECURE=true # Run ntpd to keep time synchronised in the VM - name: ntpd image: linuxkit/openntpd:dd353cac6cbd816008c565041cec6650090d0ad0 # VSOCK to unix domain socket forwarding. Forwards guest /var/run/docker.sock # to a socket on the host. - name: vsudd image: linuxkit/vsudd:5b962bdd22524b4edb7f428de745376abe359596 binds: - /var/run:/var/run command: ["/vsudd", "-inport", "2376:unix:/var/run/docker.sock"] # vpnkit-forwarder forwards network traffic to/from the host via VSOCK port 62373. # It needs access to the vpnkit 9P coordination share - name: vpnkit-forwarder image: linuxkit/vpnkit-forwarder:1dcfbb69909086be663954809e92fa2d111fecf3 binds: - /var/vpnkit:/port net: host command: ["/vpnkit-forwarder", "-vsockPort", "62373"] # Monitor for image deletes and invoke a TRIM on the container filesystem - name: trim-after-delete image: linuxkit/trim-after-delete:dc2b34b38193e6c4f6596f31075a9f6288ac7b09 # When the host resumes from sleep, force a clock resync - name: host-timesync-daemon image: linuxkit/host-timesync-daemon:562161a3a49a774ccfd5c9f3ba00d933d6f61876 # Run dockerd with the vpnkit userland proxy from the vpnkit-forwarder container. # Bind mounts /var/run to allow vsudd to connect to docker.sock, /var/vpnkit # for vpnkit coordination and /run/config/docker for the configuration file. - name: docker-dfm image: docker:20.10.6-dind capabilities: - all net: host mounts: - type: cgroup options: ["rw","nosuid","noexec","nodev","relatime"] binds: - /etc/resolv.conf:/etc/resolv.conf - /var/lib/docker:/var/lib/docker - /lib/modules:/lib/modules - /var/vpnkit:/port # vpnkit control 9p mount - /var/run:/var/run - /run/config/docker:/var/config/docker - /usr/bin/vpnkit-expose-port:/usr/bin/vpnkit-expose-port # userland proxy - /usr/bin/vpnkit-iptables-wrapper:/usr/bin/iptables # iptables wrapper command: [ "/usr/local/bin/docker-init", "/usr/local/bin/dockerd", "--", "--config-file", "/var/config/docker/daemon.json", "--swarm-default-advertise-addr=eth0", "--userland-proxy-path", "/usr/bin/vpnkit-expose-port", "--storage-driver", "overlay2" ] runtime: mkdir: ["/var/lib/docker"]