Im running docker using windows containers and i need to build my image and then get windows compiled executables for my app. Here is my Dockerfile
FROM golang:nanoserver
WORKDIR /src
COPY . .
RUN go build -o app
EXPOSE 8080
CMD ["./app"]
This is what im working with
set GOARCH=amd64
set GOEXE=.exe
set GOOS=windows
My image gets built successfully and if there was a RUN dir
in Dockerfile, you’ll see that the executables are present.
But when i try to run a container from that image like this, docker run -p 8080:8080 webapp
, i get this err
docker: Error response from daemon: container 791b7108a0a8dc7ec7b89e619707a6d97858a5483cc2089856076fc2019bf264 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!00007FF7E0E69D2B: (caller: 00007FF7E0E1E13A) Exception(2) tid(390) 80070002 The system cannot find the file specified.
CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess]
Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandLine":"./app","User":"ContainerUser","WorkingDirectory":"C:\\src","Environment":{"GOLANG_VERSION":"1.15.6","GOPATH":"C:\\gopath"},"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}.
How can i run the container successfully so i can retrieve my binaries and use them?