自己在wsl2下的Debian下安装了Docker,但是由于启动起来后,立即会出会停止
在网上找了一下解决方法
The docker installer uses iptables for nat. Unfortunately Debian uses a modified version of nftables. You can convert the entries over to nftables or just setup Debian to use the legacy iptables.
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
dockerd, should start fine after switching to iptables-legacy.
sudo service docker start
我大概翻译一下(英语略渣)
docker安装程序使用iptables进行nat,但Debian使用了nftables
您可以将设置转换为nftables或者只设置Debian以使用iptables
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
在切换到iptables legacy之后,dockerd应该可以正常启动
sudo service docker start
根据上面的方法,Docker启动成功