Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what web server is used by default for docker for .NET

I was following example docker for .NET core. There I created the dockerfile as per tutorial. I build the image and successfully run it on port 8081:80. so I can see my application running on localhost:8081. But I have some confusion there, how it is running, which server actually is responsible for running the container. I am a bit confused here cause I don't have the clear picture of what is happening there. Any resource will be much appreciated. Thanks.

here is my dockerfile

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
WORKDIR /app

# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore

# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "aspnetapp.dll"]
like image 997
Sadid Khan Avatar asked Dec 28 '25 04:12

Sadid Khan


1 Answers

By looking at the source Dockerfile -

  • sdk Dockerfile which builds on top of
  • aspnet Dockerfile which builds on top of
  • runtime Dockerfile which builds on top of
  • runtime-dep Dockerfile (which builds on top of the alpine image of course)

None of them install or configure any other web servers (Nginx, Apache etc.) to override the default web server of ASP.NET Core so it has to be Kestrel.

like image 129
Victor Wong Avatar answered Dec 30 '25 22:12

Victor Wong



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!