SteeltoeOSS / InitializrConfig

Configuration store for Steeltoe.Initializr.ConfigServer
Apache License 2.0
0 stars 3 forks source link

.NET docker incorrect and out of date #72

Closed ddieruf closed 3 years ago

ddieruf commented 3 years ago

When I created a project targeting net5.0 with the docker dependency I got

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80

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

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

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

Here is what I was hoping for

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

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

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

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "example_app.dll"]