0

I created a Windows console app and in that console app I added Docker Orchestration support using "Docker Compose". When I run it by clicking on Docker Compose, it runs successfully

See in below image screenshot it shows I have added Docker file, I also have Docker Compose project. You can also see I have run by clicking "Docker Compose".

enter image description here

Now when I run it using Docker command as below

 docker run -it consoleappcontainer:dev

It throws below error

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: container aedbd4bd0f60eb0184cce3570be103d121c516eac3cf222662258f6dd0ca0c50 encountered an error during 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(174)\vmcomputeagent.exe!00007FF7303DC00A: (caller: 00007FF7303AECEA) Exception(2) tid(380) 80070002 The system cannot find the file specified.
    CallContext:[\Bridge_ProcessMessage\ComputeSystemManager_ExecuteProcess\VmHostedContainer_ExecuteProcess]
 Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandLine":"C:\\app\\ConsoleAppContainer.exe","WorkingDirectory":"C:\\app","Environment":{"COMPLUS_NGenProtectedProcess_FeatureEnabled":"0"},"EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[50,192]}.

See error screenshot enter image description here

Below is my DOCKER file

FROM microsoft/dotnet-framework:4.7.2-runtime-windowsservercore-1803
ARG source
WORKDIR /app
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["C:\\app\\ConsoleAppContainer.exe"]

Why can't it find the EXE when it ran correctly using DOCKER COMPOSE button?

sebagomez
  • 9,501
  • 7
  • 51
  • 89
Sujit Singh
  • 752
  • 1
  • 9
  • 23
  • Did you ever fix this issue? Currently, hitting a similar issue with my dockerfile. – Andy Apr 20 '20 at 12:11

1 Answers1

0

I don't know exactly what Visual Studio does when you run from there... see if there's something in the Output Window that could give you a hint...

One more thing, when docker compose is involved you should start it with docker-compose up. The docker-compose.yml file must have something that you're missing when you want to just start the container with docker run

sebagomez
  • 9,501
  • 7
  • 51
  • 89
  • oh, I thought starting with Docker Compose is like running a container because image file gets created and a process is shown as running in Docker console. Now I am a bit confused what this running from Docker Compose means (there is only this option in visual studio). – Sujit Singh Feb 24 '19 at 02:22
  • take a look at the `docker-compose.yml` file and share it in your question – sebagomez Feb 24 '19 at 19:39