赞
踩
环境:WSL2 Ubuntu2204.1.0.7
问题描述:通过 service docker start 启动显示 OK,但是 service docker status 显示 Docker is not running,查看日志 cat /var/log/docker.log 发现如下报错:
failed to start daemon: Error initializing network controller: error obtaining controller instance: unable to add return rule in DOCKER-ISOLATION-STAGE-1 chain: (iptables failed: iptables --wait -A DOCKER-ISOLATION-STAGE-1 -j RETURN: iptables v1.8.7 (nf_tables): RULE_APPEND failed (No such file or directory): rule in chain DOCKER-ISOLATION-STAGE-1
(exit status 4))
解决方法:切换 iptables 为 legacy 模式
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
sudo update-alternatives --set arptables /usr/sbin/arptables-legacy
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。