Windows Docker在hcshim::系统::创建过程中遇到错误:Windows系统调用失败:系统找不到指定的文件

whhtz7ly  于 2023-02-21  发布在  Docker
关注(0)|答案(3)|浏览(211)

我对Docker还是个新手,正尝试构建一个Windows容器,但在运行它时遇到了这个问题。如有任何帮助,我将不胜感激。

(base) D:\src\WebIntelligence\bling\blingDemo\Models>docker run -p 4200:4200 -it blingcontainer.azurecr.io/sdbackendfy22h2:v2.8 /bin/bash
docker: Error response from daemon: container c8a7a0c947264b7d07afc5e6c44aa5a8022ff7d12729f3cdf1fba2e1ba2f293a encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2)
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent.exe!00007FF73B53AE77: (caller: 00007FF73B4EE4AB) Exception(2) tid(388) 80070002 The system cannot find the file specified.
    CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess]
 Provider: 00000000-0000-0000-0000-000000000000].

停靠文件:

FROM woailaosang/sdserver:v1.2
MAINTAINER MyName

COPY SDWebServer/ Users/Administrator/Downloads/Models/SDWebServer/

构建命令:

(base) D:\src\WebIntelligence\bling\blingDemo\Models>docker build -t blingcontainer.azurecr.io/sdbackendfy22h2:v2.8 .
Sending build context to Docker daemon   6.26GB
Step 1/3 : FROM woailaosang/sdserver:v1.2
 ---> 4de20ecd31b8
Step 2/3 : MAINTAINER MyName
 ---> Using cache
 ---> 59cc461e724f
Step 3/3 : COPY SDWebServer/ Users/Administrator/Downloads/Models/SDWebServer/
 ---> Using cache
 ---> 1ab457109f43
Successfully built 1ab457109f43
Successfully tagged blingcontainer.azurecr.io/sdbackendfy22h2:v2.8
vd8tlhqk

vd8tlhqk1#

结果我应该使用cmd.exe而不是/bin/bash运行,因为它是Windows机器上的Windows Docker映像。

8nuwlpux

8nuwlpux2#

好吧,在我的例子中,我在Windows 10上运行Docker容器时遇到了完全相同的错误,我在Dockerfile中有CMD。但是,当我在它之前添加ENTRYPOINT时,我的容器成功运行:

ENTRYPOINT ["powershell.exe"]
CMD ["npm", "run", "prod-win"]
bvk5enib

bvk5enib3#

当你得到这样的错误,大多数时候,你会得到确切的错误信息:

docker logs <container>

相关问题