本文主要是介绍wsl2安装完docker启动不了问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
wsl2中安装完docker,使用启动命令
sudo service docker start
提示docker在启动,但是使用命令
docker ps
后仍然提示
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
原因:
通过系统工具update-alternatives 可以配置和切换当前系统中的iptables 环境做到多版本管理。
切换iptables版本解决WSL2中docker运行异常的问题。
解决办法:
查看当前配置信息
$ sudo update-alternatives --config iptablesThere are 2 choices for the alternative iptables (providing /usr/sbin/iptables).Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/sbin/iptables-nft 20 auto mode1 /usr/sbin/iptables-legacy 10 manual mode2 /usr/sbin/iptables-nft 20 manual modePress <enter> to keep the current choice[*], or type se
这篇关于wsl2安装完docker启动不了问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!