在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>

当前回答

这在win10-home https://github.com/docker/for-win/issues/11967上为我工作

关闭服务docker 现在在窗口命令终端中执行该命令 \AppData\漫游\Docker 启动服务docker 现在点击Docker Desktop

“Docker桌面”现在将运行…做……:)

其他回答

错误与这部分有关:

在Windows上的默认守护进程配置中,docker客户端必须 被提升运行连接

首先,验证Docker Desktop应用程序正在运行。如果没有,启动它:这将运行docker守护进程(只需等待几分钟)。 然后,如果错误仍然存在,您可以尝试切换Docker守护进程类型,如下所示:

Powershell:

以管理员身份打开Powershell 启动命令:& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon .exe

或者,使用cmd:

以管理员身份打开cmd 启动命令:“C:\Program Files\Docker\Docker\DockerCli.exe”-SwitchDaemon

我的一个朋友也有类似的问题,我们尝试了一下,效果很好。

Hyper-V,尽管在“打开或关闭Windows功能”中被列为活动,但实际上并不是活动的。当在PowerShell下运行systeminfo时,这变得很明显,并且看到 要求被列出为满足(这不是您期望的Hyper-V实际运行的输出)。步骤:

打开“打开或关闭Windows功能” 如果您不确定如何做到这一点,请参考 https://www.howtogeek.com/250228/what-windows-10s-optional-features-do-and-how-to- [turn-them-on-or-off /] [1] 关闭Hyper-V(取消复选框,确保所有子组件都被标记为关闭) 点击“Ok”-你的机器将重新启动。 当你的电脑再次启动时,打开“打开或关闭Windows功能”,然后重新打开Hyper-V。您的机器将重新启动。

现在你可以通过运行docker hello-world image进行测试。

您可以运行“C:\Program Files\Docker\Docker\DockerCli.exe”-SwitchDaemon并将Docker CLI指向Linux或Windows容器。这对我很管用。

Windows系统- 打开'Docker for Desktop'打开调试图标->点击'Reset to factory defaults'

遇到类似的问题,在运行在WSL2上的Windows虚拟机上安装了docker桌面。

解决方案:

更新Windows到最新版本,VMTools到最新(11.2)版本,修复了这个问题,现在docker正在不停地运行。