Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Have consistent way to terminate server across platforms #59
I was trying to run ASP.NET web servers inside Docker containers using “k web” command, I realized that Microsoft.AspNet.Hosting waits for console input to terminate web server. (see this line https://github.com/aspnet/Hosting/blob/dev/src/Microsoft.AspNet.Hosting/Program.cs#L90 )
This is preventing the process inside Docker container to terminate when no stdin is attached. (workaround: if I run the container with
I suggest removing this behavior, it doesn’t make sense to terminate upon stdin input, users always have Ctrl+C option to terminate and by convention, server applications are designed to be daemons and should not be interacting with STDIN.
As a work-around, I created a shell script that behaves as a daemon and uses a fifo to cleanly shutdown the
Tested on OS X but haven't tried wiring it into Docker.