Dockerfile :
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
WORKDIR /app
COPY WebApi.exe /app
RUN ls
ENTRYPOINT ["/app/WebApi.exe"]
Command used to build image and then run container:
docker build -t hello .
docker run -d -t --name helloContainer hello
Error :
ca82a2934274e45abb991ec357d32de28d6ce4da092d6634af8a74c8f4106185 docker: Error response from daemon: container ca82a2934274e45abb991ec357d32de28d6ce4da092d6634af8a74c8f4106185 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!00007FF7B789A41B: (caller: 00007FF7B7855BDB) Exception(2) tid(3b4) 80070002 The system cannot find the file specified. CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess] Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandLine":"/app/WebApi.exe","WorkingDirectory":"C:\app","Environment":{"COMPLUS_NGenProtectedProcess_FeatureEnabled":"0","DOTNET_RUNNING_IN_CONTAINER":"true","DOTNET_USE_POLLING_FILE_WATCHER":"true","NUGET_VERSION":"5.5.1","ROSLYN_COMPILER_LOCATION":"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Roslyn"},"EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[55,237]}.