Debian Docker 安装时出现以下错误:
Dec 08 16:43:28 rescue dockerd[80363]: time="2024-12-08T16:43:28.539573984+01:00" level=info msg="Starting up"
Dec 08 16:43:28 rescue dockerd[80363]: time="2024-12-08T16:43:28.540053957+01:00" level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/r>
Dec 08 16:43:28 rescue dockerd[80363]: time="2024-12-08T16:43:28.552367506+01:00" level=info msg="[graphdriver] using prior storage driver: fuse-overlayfs"
Dec 08 16:43:28 rescue dockerd[80363]: time="2024-12-08T16:43:28.552488023+01:00" level=info msg="Loading containers: start."
Dec 08 16:43:28 rescue dockerd[80363]: time="2024-12-08T16:43:28.556884077+01:00" level=info msg="unable to detect if iptables supports xlock: 'iptables --wait -L -n': iptables v1.8.9 (nf_tables): Cou>
Dec 08 16:43:28 rescue dockerd[80363]: time="2024-12-08T16:43:28.617504133+01:00" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd namespace=moby
Dec 08 16:43:28 rescue dockerd[80363]: failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to register "bridge" driver: failed to create NAT chain>
Dec 08 16:43:28 rescue dockerd[80363]: (exit status 4)
Dec 08 16:43:28 rescue systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
解决方式:
原因:iptables当前是nft,而不是legacy
- 检查iptables
iptables --version
如果提到nf_tables,则后端是nftables,否则需要切换.
- 切换nftables
update-alternatives --config iptables
根据以下选项进行切换。
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/sbin/iptables-nft 20 auto mode
1 /usr/sbin/iptables-legacy 10 manual mode
2 /usr/sbin/iptables-nft 20 manual mode
说明当前是nft,而不是1,选择1即可
- 选择后,再次验证,是否为legacy,如果是,重启即可
iptables --version
systemctl restart docker
1577

被折叠的 条评论
为什么被折叠?



