在WSL中成功安装Docker后,如果我运行标准的Docker命令,则会出现连接错误.在所有示例中,使用sudo运行或不运行会产生相同的结果.
root@SUR002731165154:~# sudo docker info
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
root@SUR002731165154:~# sudo docker version
Client:
Version: 1.13.1
API version: 1.26
Go version: go1.7.5
Git commit: 092cba3
Built: Wed Feb 8 06:42:29 2017
OS/Arch: linux/amd64
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Run Code Online (Sandbox Code Playgroud)
但是,如果我将-H localhost:2375添加到命令我可以运行Docker没问题.Docker是连接到我的localhost Windows 10计算机还是在WSL上本地运行,或者两者兼而有之?
root@SUR002731165154:~# docker -H localhost:2375 version
Client:
Version: 1.13.1
API version: 1.26
Go version: go1.7.5
Git commit: 092cba3
Built: Wed Feb 8 …Run Code Online (Sandbox Code Playgroud)