i run dockerfile
#servercore its mine tag
FROM servercore
COPY ./prog./work/prog
WORKDIR /work
CMD ["cmd.exe", "/c", "start /b C:\\work\\prog\\prog.exe"]
then inside of container i type tasklist and see
in this case my program doesn`t work
Also i tried to run exe inside windows servercore with terminal
and my program is fully working, which can be seen in memory in the task manager
How can і run exe by dockerfile ?
It might have happened because when you are trying to start your app.exe from different path then your app. It might throw some exception because app does not see all dependencies/resources etc. You should change your workdir from
WORKDIR /worktoWORKDIR /work/progand in CMD ./prog.exe.