Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

371
Views
Docker image for .net 5

Typically I use following images for .net core 3.1 and it works fine.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build

I have for experimental reason started a new .net 5 project and created dockerfile with following

FROM mcr.microsoft.com/dotnet/core/aspnet:5.0-buster-slim AS base 
FROM mcr.microsoft.com/dotnet/core/sdk:5.0-buster AS build

and have following issue:

 => ERROR [internal] load metadata for mcr.microsoft.com/dotnet/core/sdk:5.0-buster                           0.2s
 => ERROR [internal] load metadata for mcr.microsoft.com/dotnet/core/aspnet:5.0-buster-slim                   0.2s
 => CANCELED [build 1/7] FROM mcr.microsoft.com/dotnet/core/sdk:5.0-buster                                    0.0s
 => => resolve mcr.microsoft.com/dotnet/core/sdk:5.0-buster                                                   0.0s
 => [internal] load build context                                                                             0.0s
 => ERROR [base 1/2] FROM mcr.microsoft.com/dotnet/core/aspnet:5.0-buster-slim                                0.0s
 => => resolve mcr.microsoft.com/dotnet/core/aspnet:5.0-buster-slim
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You do not have to write this yourself. A quick way to go about it is to use the dockerfile generator as explained by Julio Casal in this quick tutorial https://www.youtube.com/watch?v=wQSuZFd01tY.

A sample code for MyApp will look like

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

ENV ASPNETCORE_URLS=http://+:80

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["MyApp/MyApp.csproj", "MyApp/"]
RUN dotnet restore "MyApp/MyApp.csproj"
COPY . .
WORKDIR "/src/MyApp"
RUN dotnet build "MyApp.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "MyApp.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MyApp.dll"]

over 4 years ago · Santiago Trujillo Report

0

As I read here, it is changed to:

FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build

It is also mentioned on the docker hub with more info:

As part of the .NET 5.0 release, all .NET Docker images (including .NET Core 2.1 and 3.1) have transitioned to a new set of Docker repositories described below. Updates will continue to be made to supported tags in the old repository locations for backwards compatibility. Please update any repository references to these new names. For more information see the .NET 5.0 repository rename announcement.

enter image description here


EDIT: Image descriptions:

Image Comments
mcr.microsoft.com/dotnet/runtime:5.0 .NET 5 multi-architecture: Supports Linux and Windows Nano Server depending on the Docker host.
mcr.microsoft.com/dotnet/aspnet:5.0 ASP.NET Core 5.0 multi-architecture: Supports Linux and Windows Nano Server depending on the Docker host. The aspnetcore image has a few optimizations for ASP.NET Core.
mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim .NET 5 runtime-only on Linux Debian distro
mcr.microsoft.com/dotnet/aspnet:5.0-nanoserver-1809 .NET 5 runtime-only on Windows Nano Server (Windows Server version 1809)

Image description reference.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!