vib*_*rma 6 shell docker windows-subsystem-for-linux
我在运行时收到此错误
>service docker start
docker: unrecognized service
>service docker.io start
docker.io: unrecognized service
Run Code Online (Sandbox Code Playgroud)
我正在与 docker 斗争以运行它。我有Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?错误。此后我尝试了几件事,但没有奏效。
>docker pull pstothard/cgview
Using default tag: latest
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
>sudo docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
>systemctl start docker.service
System has not been booted with systemd as init system (PID 1). Can't operate.
>docker images
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:
Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/json: dial unix /var/run/docker.sock: connect: permission denied
>snap stop docker
Interacting with snapd is not yet supported on Windows Subsystem for Linux.
This command has been left available for documentation purposes only.
Run Code Online (Sandbox Code Playgroud)
我在 Windows 系统中使用 ubuntu 18.04 应用程序。我该怎么办?
好像 WSL 无法连接到通过 Docker for Windows 运行的 docker 守护进程,可能是因为它没有暴露或没有运行。
WSL1
如果您使用 WSL 1,您可以通过 Docker for Windows 中的此选项公开 docker 守护程序:
我推荐这篇文章以获得详细的指南。
我强烈建议在 WSL 2 中运行 docker,因为它提供更快的启动时间并允许 docker 动态使用 CPU/RAM,而不必预先分配它。
WSL2
如果您使用的是 WSL 2,则必须通过 Docker for Windows 为 docker 启用 WSL 2 后端。Docker 团队在此处提供了广泛的指南。
小智 5
如果返回,请尝试手动启动 docker deamon ( sudo dockerd) 。sudo docker run hello-worldIs the docker daemon running?
| 归档时间: |
|
| 查看次数: |
24408 次 |
| 最近记录: |