Docker LCOW WS2019中的Linux容器启动问题:CreateProcess期间出错:Windows系统调用失败:未指定错误(0x80004005)

Docker LCOW WS2019中的Linux容器启动问题:CreateProcess期间出错:Windows系统调用失败:未指定错误(0x80004005),docker,dockerfile,linux-containers,Docker,Dockerfile,Linux Containers,上下文:我尝试从docker文件创建Linux容器,如下所示: 生成环境:Windows Server 2019 根据在WS2019上启用LCOW Dockerfile FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-focal WORKDIR /app # Copy build COPY ./bin/ ./bin COPY ./docker/start.sh ./bin # This converts line endings from Wind

上下文:我尝试从docker文件创建Linux容器,如下所示:

生成环境:Windows Server 2019

根据在WS2019上启用LCOW

Dockerfile

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-focal
WORKDIR /app

# Copy build
COPY ./bin/ ./bin
COPY ./docker/start.sh ./bin

# This converts line endings from Windows-style to unix-style. If the bash script has windows style endings, it will not run
RUN sed -i 's/\r$//' ./bin/start.sh

# Setup app
EXPOSE 4900
ENTRYPOINT ["./bin/start.sh"]
我得到以下例外情况:

ERROR: for app-testwebapi-linux-x64  Cannot start service app-testwebapi-linux-x64: container 1a10c15c608f98f5aa6997431c9ea2d6dd58e77e03bfff5efcaf164635c47263 encountered an error during CreateProcess: failure in a Windows system call: Unspecified error (0x80004005)
[Event Detail: failed to run runc create/exec call for container 1a10c15c608f98f5aa6997431c9ea2d6dd58e77e03bfff5efcaf164635c47263: exit status 1 Stack Trace:
github.com/Microsoft/opengcs/service/gcs/runtime/runc.(*container).startProcess
        /go/src/github.com/Microsoft/opengcs/service/gcs/runtime/runc/runc.go:578
github.com/Microsoft/opengcs/service/gcs/runtime/runc.(*runcRuntime).runCreateCommand
        /go/src/github.com/Microsoft/opengcs/service/gcs/runtime/runc/runc.go:469
github.com/Microsoft/opengcs/service/gcs/runtime/runc.(*runcRuntime).CreateContainer
        /go/src/github.com/Microsoft/opengcs/service/gcs/runtime/runc/runc.go:113
github.com/Microsoft/opengcs/service/gcs/core/gcs.(*gcsCore).ExecProcess
        /go/src/github.com/Microsoft/opengcs/service/gcs/core/gcs/gcs.go:354
github.com/Microsoft/opengcs/service/gcs/bridge.(*Bridge).execProcess
        /go/src/github.com/Microsoft/opengcs/service/gcs/bridge/bridge.go:585
github.com/Microsoft/opengcs/service/gcs/bridge.(*Bridge).(github.com/Microsoft/opengcs/service/gcs/bridge.execProcess)-fm
        /go/src/github.com/Microsoft/opengcs/service/gcs/bridge/bridge.go:236
github.com/Microsoft/opengcs/service/gcs/bridge.HandlerFunc.ServeMsg
        /go/src/github.com/Microsoft/opengcs/service/gcs/bridge/bridge.go:68
github.com/Microsoft/opengcs/service/gcs/bridge.(*Mux).ServeMsg
        /go/src/github.com/Microsoft/opengcs/service/gcs/bridge/bridge.go:139
github.com/Microsoft/opengcs/service/gcs/bridge.(*Bridge).ListenAndServe.func2.1
        /go/src/github.com/Microsoft/opengcs/service/gcs/bridge/bridge.go:315
runtime.goexit
        /usr/lib/go/src/runtime/asm_amd64.s:2361 Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandArgs":["./bin/start.sh"],"WorkingDirectory":"/app","Environment":{"ASPNETCORE_URLS":"http://+:80","DOTNET_RUNNING_IN_CONTAINER":"true","HOSTNAME":"1a10c15c608f","PATH":"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0],"OCISpecification":{"ociVersion":"1.0.1-dev","process":{"user":{"uid":0,"gid":0},"args":["./bin/start.sh"],"env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","HOSTNAME=1a10c15c608f","ASPNETCORE_URLS=http://+:80","DOTNET_RUNNING_IN_CONTAINER=true"],"cwd":"/app","capabilities":{"bounding":[
为什么会出现这种例外?这是什么意思?

问题 start.sh没有执行的权限

解决方案#1 按如下方式授予对.sh文件的执行权限

RUN chmod +x ./bin/start.sh
解决方案#2 备选方案

而不是

COPY ./bin/ ./bin
COPY ./docker/start.sh ./bin
使用start.sh的文件夹副本(位于./bin时)

将有助于正确启动服务

奇怪,但是,从文件夹副本更改为文件副本是在我开始看到问题的时候

COPY ./bin/ ./bin