unable to detect if iptables supports xlock: ‘iptables --wait -L -n‘: iptables v1.8.9 (nf_tables): C

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

  1. 检查iptables
 iptables --version

如果提到nf_tables,则后端是nftables,否则需要切换.

  1. 切换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即可

  1. 选择后,再次验证,是否为legacy,如果是,重启即可
 iptables --version
 systemctl restart docker
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值