When I create a new project based on the Arcus Messaging template, I can see that the generated dockerfile looks like this:
FROM mcr.microsoft.com/dotnet/sdk:6.0.301-alpine3.14 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:6.0.301-alpine3.14 AS build
WORKDIR /src
COPY ["Arcus.Templates.ServiceBus.Topic.csproj", ""]
COPY . .
WORKDIR "/src/."
RUN dotnet build "Arcus.Templates.ServiceBus.Topic.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "Arcus.Templates.ServiceBus.Topic.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Arcus.Templates.ServiceBus.Topic.dll"]
So, this means that the base-image that is used for running the project, is an SDK image. This is not necessary. We must use a 'runtime' image, like f.i. 6.0.25-alpine3.18-amd64
We must review all Dockerfiles in all templates to make sure that no 'sdk' versions are used for running our projects.
When I create a new project based on the Arcus Messaging template, I can see that the generated dockerfile looks like this:
So, this means that the base-image that is used for running the project, is an SDK image. This is not necessary. We must use a 'runtime' image, like f.i.
6.0.25-alpine3.18-amd64
We must review all Dockerfiles in all templates to make sure that no 'sdk' versions are used for running our projects.