I have a console application written in C # using a utility program that takes the following form:
static void Main(string[] args)
{
Console.ReadKey();
}
This code works great when running on Windows as a console. The implementation is almost exactly https://github.com/ServiceStack/ServiceStack/wiki/Self-hosting as this is a test project
Then I will compile this project using mono on linux and creating a docker file.
I have no problem running a container based on this image if it is interactive
docker run -it --name bob -p 1337:1337 <myservice>
The container runs in the foreground
, -it, - , STDIN, Console.ReadKey() .
, , . , , ...
, (docker run -d...)