[英]Windows Linux subsystem : Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I tried to install docker over windows10 Linux subsystem ubuntu 18.04 LTS but not able to run the docker container please find the result of some commands我尝试在 windows10 Linux 子系统 ubuntu 18.04 LTS 上安装 docker 但无法运行 docker 容器请找到一些命令的结果
Followed the official docker document to install docker [ https://docs.docker.com/install/linux/docker-ce/ubuntu/][1]按照docker官方文档安装docker [ https://docs.docker.com/install/linux/docker-ce/ubuntu/][1]
**$ cat /proc/version**
Linux version 4.4.0-17763-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #864-Microsoft Thu Nov 07 15:22:00 PST 2019
**$ lsb_release -a**
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
**$ docker version**
Client:
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:49:01 2018
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
$ sudo systemctl start docker.service
System has not been booted with systemd as init system (PID 1). Can't operate.
$ sudo /etc/init.d/docker start
* Starting Docker: docker
$ sudo /etc/init.d/docker status
* Docker is not running
WSL does not boot with systemd. WSL 无法使用 systemd 启动。
If you use WSL1, you can't run docker this way(but with Hyper-V)如果您使用 WSL1,则不能以这种方式运行 docker(但使用 Hyper-V)
There is a workaround for WSL 2: WSL 2 有一个解决方法:
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
If you run this, systemd will start but you'll have to re-run this every time you restart WSL.如果您运行它,systemd 将启动,但您每次重新启动 WSL 时都必须重新运行它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.