目前需要我们手动配置开启 systemd,即在 WSL 启动时执行 wsl-systemd 即可:

参考源地址:WSL2 Ubuntu 22.04 安装踩坑记录_零度冰华的博客-CSDN博客

sudo vim /etc/wsl.conf [boot] command="/usr/libexec/wsl-systemd"

配置网卡,参考源地址:https://github.com/docker/for-linux/issues/1105

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy ensure that /etc/sysctl.conf includes: net.ipv4.ip_forward = 1

重启wsl

wsl -t Ubuntu22.04

启动docker

systemctl start docker

#查看docker输出日子

dockerd --debug

该方法本人实践可行

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐