Linux container start-up issue in LCOW WS2019: error during CreateProcess: failure in a Windows system call: Unspecified error (0x80004005)

0

Context: I try to create Linux container from docker file, given below:

Build environment: Windows Server 2019

Enabled LCOW on WS2019 per https://sebastiangogola.com/lcow-linux-containers-on-windows/

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"]

I get the following exception:

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":[

Why this exception? What does it mean?

docker
dockerfile
linux-containers
asked on Stack Overflow Nov 10, 2020 by Abin

1 Answer

0

Issue

start.sh didn't have permission to execute.

Solution #1

grant execute permission on .sh file as below,

RUN chmod +x ./bin/start.sh

Solution #2

Alternative,

Instead of,

COPY ./bin/ ./bin
COPY ./docker/start.sh ./bin

using folder copy of start.sh (when located at ./bin),

COPY ./bin/ ./bin

would help service start-up correctly.

Weird, but, making the change from folder-copy to file-copy is when I started to see the issue.

answered on Stack Overflow Nov 10, 2020 by Abin

User contributions licensed under CC BY-SA 3.0