使用 Docker for Mac,我可以使用 socat 和 screen 进入 linuxkit VM。以下是 linuxkit VM 内路由的输出:
/ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.65.1 0.0.0.0 UG 202 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
172.17.0.0 * 255.255.0.0 U 0 0 0 docker0
192.168.65.0 * 255.255.255.0 U 202 0 0 eth0
192.168.65.5 * 255.255.255.255 UH 0 0 0 services1
192.168.65.5 是 dns 服务器,192.168.65.1 是网关。这些IP在哪里?他们不在主机上。它们是否配置在运行在 linuxkit VM 内的 vpnkit-forwarder 和 dns-forwarder 容器中?我试图进入这些容器但失败了。
/ # ctr -n services.linuxkit tasks exec -t --exec-id 935 vpnkit-forwarder /bin/sh
ctr: OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown
/ # ctr -n services.linuxkit tasks ls
TASK PID STATUS
acpid 919 STOPPED
allowlist 967 RUNNING
docker 1275 RUNNING
trim-after-delete 1630 RUNNING
dhcpcd 1126 RUNNING
diagnose 1173 RUNNING
kmsg 1405 STOPPED
socks 1576 STOPPED
vpnkit-forwarder 1734 RUNNING
binfmt 1013 STOPPED
sntpc 1523 RUNNING
devenv-service 1072 RUNNING
dns-forwarder 1224 RUNNING
http-proxy 1333 RUNNING
volume-contents 1686 RUNNING