按照一些教程安装了docker之后,比如这个:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04
我尝试启动 docker 服务,它说正在尝试启动(由于我得到了,所以 systemctl 功能对我来说不起作用System has not been booted with systemd as init system
):
$ sudo service docker start
* Starting Docker: docker
但它永远不会像运行时显示的那样启动
$ sudo service docker status
* Docker is not running
答案1
正如 Marco 在这里所说:
https://crapts.org/2022/05/15/install-docker-in-wsl2-with-ubuntu-22-04-lts/
解决此问题的步骤如下:
sudo update-alternatives --config iptables
- 输入数字“1”并按 Enter 选择“iptables-legacy”
sudo service docker start