We are containerize a inhouse .NET 4.7 console app using Windows docker image mcr.microsoft.com/windows/servercore:ltsc2019.
docker run my-image is hang when running however docker run -t my-image is working fine.
dockerfile:
FROM mcr.microsoft.com/windows/servercore:ltsc2019
COPY c:/myapp/ ./myapp/
RUN c:\windows\system32\regsvr32.exe /s c:\myapp\somedll.dll
RUN "c:\myapp\myapp.exe" mydata.csv
Any idea please?
docker run [image name]command run the container and wait for it until the process ends.with
-toption, we can connect the current console(tty) to the container, so we can see the output.with
-ioption, we can also use input (interactive mode).with
-doption, we can detach the container so it could run like a server.Typically, use
run -doption for server start andrun -tioption for debugging.I think a docker container not much different from a local process. We could run it foreground (-ti) or background (-d).