Docker 无法在 Windows 上启动。

451

Windows 上执行 docker version 命令将返回以下结果:

C:\Projects> docker version
Client:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   d8d3314
 Built:        Tue Nov  1 03:05:34 2016
 OS/Arch:      windows/amd64
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.25/version: open //./pipe/docker_engine: The system cannot find the file
specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

运行诊断程序会产生以下结果:

C:\Projects> wget https://github.com/Microsoft/Virtualization- 
Documentation/raw/master/windows-server-container-tools/Debug- 
ContainerHost/Debug-ContainerHost.ps1 -UseBasicParsin | iex

Checking for common problems
Describing Windows Version and Prerequisites
 [+] Is Windows 10 Anniversary Update or Windows Server 2016 608ms
 [+] Has KB3192366, KB3194496, or later installed if running Windows build 14393 141ms
 [+] Is not a build with blocking issues 29ms
Describing Docker is installed
 [-] A Docker service is installed - 'Docker' or 'com.Docker.Service'  134ms
   Expected: value to not be empty
   27:         $services | Should Not BeNullOrEmpty
   at <ScriptBlock>, <No file>: line 27
 [+] Service is running 127ms
 [+] Docker.exe is in path 2.14s
Describing User has permissions to use Docker daemon
 [+] docker.exe should not return access denied 42ms
Describing Windows container settings are correct
 [-] Do not have DisableVSmbOplock set to 1 53ms
   Expected: {0}
   But was:  {1}
   66:              $regvalue.VSmbDisableOplocks | Should Be 0
   at <ScriptBlock>, <No file>: line 66
 [+] Do not have zz values set 42ms
Describing The right container base images are installed
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.25/images/json: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
 [-] At least one of 'microsoft/windowsservercore' or 'microsoft/nanoserver' should be installed 129ms
   ValidationMetadataException: The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
   ParameterBindingValidationException: Cannot validate argument on parameter 'Property'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
   at <ScriptBlock>, <No file>: line 90
Describing Container network is created
 [-] Error occurred in Describe block 1.08s
   RuntimeException: Cannot index into a null array.
   at <ScriptBlock>, <No file>: line 119
Showing output from: docker info

Showing output from: docker version
Client:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   d8d3314
 Built:        Tue Nov  1 03:05:34 2016
 OS/Arch:      windows/amd64

Showing output from: docker network ls

Warnings & errors from the last 24 hours
Logs saved to C:\Projects\logs_20161107-084122.csv
C:\Projects>

32
我得出结论,Windows 上的技术还不够成熟。在技术成熟之前,请使用 Linux Docker。 - Jim
使用此命令 docker-machine create box。请参考 https://github.com/docker/toolbox/issues/636。 - Mr Nobody
请确保您已经按照文档 https://docs.docker.com/machine/get-started/ 中的设置步骤进行了操作。 - fanny
有时在初始安装时会出现这种情况,但只需完成勾选接受服务级别协议的程序即可。通常,在电脑上搜索Docker桌面并单击其图标即可。 - Gilbert
1
同样适用于2021年:在问题中提到的诊断脚本的更新URL是 wget https://github.com/Microsoft/Virtualization-Documentation/raw/main/windows-server-container-tools/Debug-ContainerHost/Debug-ContainerHost.ps1 -UseBasicParsin | iex - Ben Seymour
显示剩余3条评论
61个回答

0
  1. 在“添加或删除程序”中卸载Docker
  2. 重新启动计算机
  3. 以管理员身份安装Docker(不要直接运行安装程序)
  4. 如果安装程序要求重新启动,请执行

0

首先,我下载了适用于 Windows 10、OS Built 19042 和版本 20H2 的 Docker,如此 视频 所示,但我的 Docker 处于初始阶段。我使用提供的命令运行 Docker,但在连接期间出现了以下错误:Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version: open //./pipe/docker_engine: The system cannot find the file。

然后,以下解决方案对我启动 Docker 有所帮助:

  1. 以管理员身份打开 Powershell 并运行此命令:'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon

或者

  1. 以管理员身份打开 cmd 并运行此命令:"C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon

enter image description here

我从这里找到了这个。希望这也能对你有所帮助!


0

我遇到了这个问题,当我尝试使用命令行创建MySQL镜像时

  • 为了解决这个问题,我只是等待Docker Desktop应用程序启动并正确运行,然后再次尝试。enter image description here


0

我遇到了同样的问题。我通过启用 Hyper-V 来解决这个问题。

  1. 在 BIOS 中启用虚拟化
  2. 安装 Hyper-V

0
随着Docker的最新更新,我遇到了一个问题,即Docker应用程序在启动时挂起。通过使用任务管理器终止wsl.exe来解决这个问题。

enter image description here


0

对我来说,这个问题通过在Docker桌面版中登录解决了。

enter image description here


0

我遇到了Windows Docker服务权限问题,只需从“网络服务”切换到“本地系统”,它就开始工作了。


0

如果你看到了这个弹窗:

enter image description here

点击弹出窗口中的链接。然后下载“适用于 x64 机器的 WSL2 Linux 内核更新包”:

enter image description here

下载完成后,进行安装。 然后重新启动Docker。它就可以工作了。


0
对我来说,Docker一直运行得很好。但在更新后,尽管它仍在运行,我却无法连接上它。
我尝试了所有这些方法(设置了DOCKER_HOST环境变量,添加了代理,以非TLS模式启动守护进程,从Docker桌面应用程序重新启动,重新启动系统,重新安装),但都没有起作用。
当我点击“退出Docker桌面应用程序的设置”后,再以管理员权限重新启动Docker桌面应用程序,它就像魔术般地正常工作了。

你的回答可以通过提供更多的支持性信息来改进。请编辑以添加进一步的细节,例如引用或文档,以便他人可以确认你的回答是否正确。你可以在帮助中心找到关于如何撰写好回答的更多信息。 - undefined

0

我也遇到了一个显示错误的问题

"Access is denied. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running."

通过以管理员身份运行 "powershell" 来解决此问题。
此解决方案将帮助那些在一个Windows机器上使用两个用户的人。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接