Docker node-windows : 神秘错误 "error during CreateProcess: failure in a Windows system call" 找不到文件

Docker node-windows : cryptic error "error during CreateProcess: failure in a Windows system call" file not found

在 windows 服务器 2016 上,安装了 docker,并尝试使用 nodejs 运行 一个 docker 图像。

docker run stefanscherer/node-windows "node -v"

抛出以下错误 "message" :

docker: Error response from daemon: container 47c736ce10987311aee01695f735bcfda52222b9effe856c44fd492685249438 encountered an error during CreateProcess: failure in a Windows system call: Le fichier spécifié est introuvable. (0x2) extra info: {"CommandLine":"\"node -v\"","WorkingDirectory":"C:\","Environment":{"NPM_CONFIG_LOGLEVEL":"info"},"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}.

一些测试

最奇怪的是,有些命令因完全相同的错误而失败,但有些命令有效。例如:

docker run stefanscherer/node-windows "hostname" => ecbf0a7a7979

docker run stefanscherer/node-windows "dir" => 上面有同样的错误 (encountered an error during CreateProcess)

docker run stefanscherer/node-windows "pwd" => </code> </p> <p>(结果似乎是一个空字符串)</p> <h1>更多测试</h1> <p><code>docker run -it stefanscherer/node-windows "cmd"

Microsoft Windows [Version 10.0.14393]                         
(c) 2016 Microsoft Corporation. All rights reserved.           

C:\>node -v                                                    
v10.9.0                                                        

C:\>npm -v                                                     
npm info it worked if it ends with ok                          
npm info using npm@6.2.0                                       
npm info using node@v10.9.0                                    
npm timing npm Completed in 353ms                              
npm info ok                                                    
6.2.0  

所以我在 docker 节点图像中有一个 shell ...并获取节点版本和所有版本,没有错误。

我的版本

windows: `Server 2016 标准评估 1607 Build14393.rs1_release.161220-1747``

docker:

λ docker -v
Docker version 18.06.1-ce, build e68fc7a

λ docker version
Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:21:34 2018
 OS/Arch:           windows/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.24)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:36:40 2018
  OS/Arch:          windows/amd64
  Experimental:     false

只需删除引号:

docker run stefanscherer/node-windows node -v

这应该有效。 Windows 尝试查找名称为 "node -v" 的可执行文件。