Windows 子系统 Ubuntu 启动 Docker 报错解决方法

Windows WSL Docker About 1,164 words

查看日志

tail -10f /var/log/docker.log

错误一

WARN[2021-12-24T14:31:23.010516400+08:00] grpc: addrConn.createTransport failed to connect to {unix:///var/run/docker/containerd/containerd.sock 0 }. Err :connection error: desc = "transport: Error while dialing dial unix:///var/run/docker/containerd/containerd.sock: timeout". Reconnecting... module=grpc failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.8.4 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. (exit status 3)

可以禁用iptables,参考:https://forums.docker.com/t/failing-to-start-dockerd-failed-to-create-nat-chain-docker/78269/6

但这样启动还是会出现错误二

sudo dockerd --iptables=false

错误二

failed to start daemon: Error initializing network controller: Error creating default "bridge" network: permission denied

解决方法

以管理员身份启动wsl.exe。(位置在:C:\Windows\System32下)。然后启动服务sudo service docker start

如果是Windows Terminal也需选择以管理员身份启动。

注意:不是在Linux子系统里的sudo管理员,是Windows右键Run as administrator

Views: 6,533 · Posted: 2022-01-08

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh