linuxkit/examples/docker-for-mac.yml
Avi Deitcher 14c29db5c2
Containerd v2.0.3 (#4112)
* containerd to semver v2.0.3

Signed-off-by: Avi Deitcher <avi@deitcher.net>

* containerd v2.0.3 plus commits to fix blkdiscard

Signed-off-by: Avi Deitcher <avi@deitcher.net>

* update containerd-dev dependencies

Signed-off-by: Avi Deitcher <avi@deitcher.net>

* updated pkg/init and pkg/containerd deps

Signed-off-by: Avi Deitcher <avi@deitcher.net>

---------

Signed-off-by: Avi Deitcher <avi@deitcher.net>
2025-03-06 17:12:07 +02:00

109 lines
4.8 KiB
YAML

# This is an example for building the open source components of Docker for Mac
kernel:
image: linuxkit/kernel:6.6.71
cmdline: "console=ttyS0 page_poison=1"
init:
- linuxkit/vpnkit-expose-port:b30e8456ac128b2ac360329898368b309ea6e477 # install vpnkit-expose-port and vpnkit-iptables-wrapper on host
- linuxkit/init:8eea386739975a43af558eec757a7dcb3a3d2e7b
- linuxkit/runc:667e7ea2c426a2460ca21e3da065a57dbb3369c9
- linuxkit/containerd:a988a1a8bcbacc2c0390ca0c08f949e2b4b5915d
- linuxkit/ca-certificates:7b32a26ca9c275d3ef32b11fe2a83dbd2aee2fdb
onboot:
# support metadata for optional config in /run/config
- name: metadata
image: linuxkit/metadata:4f81c0c3a2b245567fd7d32d799018c9614a9907
- name: sysctl
image: linuxkit/sysctl:5f56434b81004b50b47ed629b222619168c2bcdf
- name: sysfs
image: linuxkit/sysfs:7345172dbf4d436c861adfc27150af474194289b
- name: binfmt
image: linuxkit/binfmt:ce9509ccfa25002227ccd7ed8dd48d6947854427
# Format and mount the disk image in /var/lib/docker
- name: format
image: linuxkit/format:3fb088f60ed73ba4a15be41e44654b74112fd3f9
- name: mount
image: linuxkit/mount:cb8caa72248f7082fc2074ce843d53cdc15df04a
command: ["/usr/bin/mountie", "/var/lib"]
# make a swap file on the mounted disk
- name: swap
image: linuxkit/swap:f4b8ffef87c8c72165bd8a92b790ac252ccf1821
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:157df9ef45a035f1542ec2270e374f18efef98a5
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services:
# Enable acpi to shutdown on power events
- name: acpid
image: linuxkit/acpid:6cb5575e487a8fcbd4c3eb6721c23299e6ea452f
# Enable getty for easier debugging
- name: getty
image: linuxkit/getty:05eca453695984a69617f1f1f0bcdae7f7032967
env:
- INSECURE=true
# Run ntpd to keep time synchronised in the VM
- name: ntpd
image: linuxkit/openntpd:f99c4117763480815553b72022b426639a13ce86
# VSOCK to unix domain socket forwarding. Forwards guest /var/run/docker.sock
# to a socket on the host.
- name: vsudd
image: linuxkit/vsudd:127acd1453f7bfda791491ac4c55be0d2b9223cc
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:e22bb70abdb5550c369f91ae7068c24e19beff73
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:fe73247abd4ab7584a75e95083543af97fe90d4d
# When the host resumes from sleep, force a clock resync
- name: host-timesync-daemon
image: linuxkit/host-timesync-daemon:548bfe9d35c930ee42d6c0485bb4bf25d2729bad
# 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"]