Last post Jul 05, 2020 06:16 PM by bruce (sqlwork.com)
Jun 14, 2020 02:13 PM|Test1233@|LINK
I just created a sample api project and ran it inside of a container using docker commands and even created a custom image of the sample app. I am a beginner and am a bit confused right now as how is my app running inside of a container that contains just
the runtime and dotnet specific images but no IIS. I used to think that Asp.net core web app requires a server and that could be either IIS or Kestrel but in my case I didn't have any of those. I ran my app in both Linux and Windows container. While in Linux
container, I thought maybe behind the scenes Kestrel would be running but that shouldn't be the case in Windows container or maybe I am wrong all together.
So I just want to know how are the thing running in containers without a server? Also if possible can you please point me to articles explaining difference in performance as well
Jun 14, 2020 04:30 PM|bruce (sqlwork.com)|LINK
Asp.net core apps are command line programs. Krestrel is the built in library that implements a web server. You can run an asp.net core app on windows or Linux standalone and access with a browser. Just build and run the exe.
when you run asp.net in a container, you are just running the exe, and exposing the port it’s listening on.
running asp.net core standalone may be faster than hosting in iis or ngnix but you are missing features, that iis or ngnix supply. For example iis has static file caching, and can host multiple application on the same port.
Jun 17, 2020 07:24 AM|Test1233@|LINK
I thought if I deploy my application as self-contained then it would be creating exe file else dll.
Jun 17, 2020 03:07 PM|bruce (sqlwork.com)|LINK
Self contained means all the .net runtimes dlls are included rather than sharing the ones installed on the deployment computer.
in reality, there is only a dll produced. The exe is stripped down version of dotnet.exe which hosts the dll. .net core, like java requires a hosting program to run the code.
note: typically you would pull a docker container with .net core already installed. so you did not need self contained deployment.
Jun 18, 2020 01:13 AM|lextm|LINK
I used to think that Asp.net core web app requires a server and that could be either IIS or Kestrel but in my case I didn't have any of those.
You misunderstood the basic concepts here. An ASP.NET Core always runs on Kestrel (except IIS in-process hosting where IISHttpServer is used).
Therefore, on a Linux Docker container, HTTP requests land on Kestrel and then are dispatched to the middleware behind.
IIS is really optional when you host your app on Windows, but you do get some nice web server features from it (application pool for example).
Jul 05, 2020 03:47 PM|Test1233@|LINK
Ok.. On linux containers, asp.net core requests are served through kestrel but what if I am using windows container?
Jul 05, 2020 06:16 PM|bruce (sqlwork.com)|LINK
Just like you can pull a Linux container with ngnix or Apache, you can pull a windows container with iis installed. When running asp.net core in a windows container, you have the choice of hosting with iis or without.