No outputs in the cmd while using a Docker container via powershell

1

After a successful Docker test (with the standard Hello World! image) i wanted to make a self made Hello World output. So i built a standard application (.exe) which prompts "Hello World!" and is working just fine when i open it on the local machine (Windows 10). As soon as I try to open it within a docker container it just does nothing. No error messages whatsoever. It seems that the container isn't actually executing the program.

My first approach was a (windows, obviously) container with the nanoserver image from MS. But I've read that there might be missing some .dlls, so i switched to the windows server core (1607) and this still doesn't work. Other applications which are more complex aren't working (surprisingly) either, even if I map the whole development folder from Visual Studio to the container via the -v command.

I haven't used the dockerfile for now. I created the container with this powershell command: docker run -i -it --rm -v <Workdirectory>:<Workdirectory2> microsoft/windowsservercore:1607 cmd. After that i can switch the directory where the program is located and start it, but it just doesn't start.

All files which are necessary to run the program are included inside the container. The code for the Hello World program is just cout << Hello World! << endl; with the standard includes

Edit (in case anyone will ever have the same problem):

Found a solution. The problem with a standard servercore or nanoserver image is, that it hasn't got any MS Redistributables (missing DLL's). So no program which isn't included in this image can even start. Installing those Redistributables solved the problem.

PxG

Posted 2019-06-17T07:29:33.720

Reputation: 11

How did you figure out which DLLs were missing, and then how did you install them? – M-Pixel – 2019-11-09T18:47:29.407

You can find out the missing DLLs with a dependency walker. For my problem I just added VC Redistributables to the image and started that .exe with these commands in the Docker file:

ADD https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe /vc_redist.x64.exe RUN C:\vc_redist.x64.exe /quiet /install

– PxG – 2019-11-11T10:47:55.837

No answers