forked from linuxkit/linuxkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-for-mac.yml
113 lines (112 loc) · 4.82 KB
/
docker-for-mac.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# This is an example for building the open source components of Docker for Mac
kernel:
image: linuxkit/kernel:5.4.30
cmdline: "console=ttyS0 page_poison=1"
init:
- linuxkit/vpnkit-expose-port:3fd88b7025065843792484b1ad83ddd5c4b28684 # install vpnkit-expose-port and vpnkit-iptables-wrapper on host
- linuxkit/init:f670045ecb6ec31ea37dd10114366e9a1e915013
- linuxkit/runc:1eef77f5963e44e491abfe392206769037d47ae2
- linuxkit/containerd:8ee7a0d636fff9df7e13076f5492d06274e5f644
- linuxkit/ca-certificates:abfc6701b9ca17e34ac9439ce5946a247e720ff5
onboot:
# support metadata for optional config in /run/config
- name: metadata
image: linuxkit/metadata:04ce7519c2ea2eaf99bbdc76bb01fc036eed7ab0
- name: sysctl
image: linuxkit/sysctl:541f60fe3676611328e89e8bac251fc636b1a6aa
- name: sysfs
image: linuxkit/sysfs:697f996868d6625a78bbbefb199d7b6b6ae3533a
- name: binfmt
image: linuxkit/binfmt:94d59bc179c7a9155d8593a974d499352b70bfd5
# Format and mount the disk image in /var/lib/docker
- name: format
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69
command: ["/usr/bin/mountie", "/var/lib"]
# make a swap file on the mounted disk
- name: swap
image: linuxkit/swap:2cf5c3f08c4b238bb5fe231fd59ce19faee0fbc6
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.11
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.11
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:2f8a9b670aa6e96a09db56ec45c9f07ef2a811ee
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services:
# Enable acpi to shutdown on power events
- name: acpid
image: linuxkit/acpid:d5692a8c9d7cfceb7922acb8e356928c920bc280
# Enable getty for easier debugging
- name: getty
image: linuxkit/getty:48f66df198981e692084bf70ab72b9fe2be0f880
env:
- INSECURE=true
# Run ntpd to keep time synchronised in the VM
- name: ntpd
image: linuxkit/openntpd:9b33f59f6d66c0f5027754a75e52f972e11882c1
# VSOCK to unix domain socket forwarding. Forwards guest /var/run/docker.sock
# to a socket on the host.
- name: vsudd
image: linuxkit/vsudd:0366cd7fb47398de85b176f3b0420355cda235fa
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:e0964f3c34f92f7e7ff7b13e360d57559c64581c
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:f5a83f55b1bc24d61bca4891d997bca33474945d
# When the host resumes from sleep, force a clock resync
- name: host-timesync-daemon
image: linuxkit/host-timesync-daemon:8625ccdbda099c94b9635acd167e8f0e2f9c6318
# 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:19.03.8-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"]
trust:
org:
- linuxkit
- library