running exe in windows server core on docker windows container

485 Views Asked by At

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 tasklist in this case my program doesn`t work

Also i tried to run exe inside windows servercore with terminal tasklist and my program is fully working, which can be seen in memory in the task manager

How can і run exe by dockerfile ?

1

There are 1 best solutions below

0
Scroll On BEST ANSWER

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 /work to WORKDIR /work/prog and in CMD ./prog.exe.