Windows Docker在hcsshim::System::CreateProcess: failure in a



我对Docker相当陌生,并试图构建一个Windows容器,但是当我去运行它时遇到了这个问题。如有任何帮助,不胜感激。

(base) D:srcWebIntelligenceblingblingDemoModels>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: onecorevmcomputemanagementorchestrationvmhostedcontainerprocessmanagement.cpp(173)vmcomputeagent.exe!00007FF73B53AE77: (caller: 00007FF73B4EE4AB) Exception(2) tid(388) 80070002 The system cannot find the file specified.
CallContext:[Bridge_ProcessMessageVmHostedContainer_ExecuteProcess]
Provider: 00000000-0000-0000-0000-000000000000].

Dockerfile:

FROM woailaosang/sdserver:v1.2
MAINTAINER MyName
COPY SDWebServer/ Users/Administrator/Downloads/Models/SDWebServer/

构建命令:

(base) D:srcWebIntelligenceblingblingDemoModels>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

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

在我的情况下,我得到完全相同的错误在Windows 10上运行docker容器我有CMD在Dockerfile。但是,当我在它之前添加ENTRYPOINT时,我的容器成功运行:

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

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

docker logs <container>

相关内容

最新更新