# escape=` # Learn about building .NET container images: # https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md ARG TAG=ltsc2022 FROM mcr.microsoft.com/dotnet/sdk:9.0-nanoserver-$TAG AS build WORKDIR /source # Copy project file and restore as distinct layers COPY --link *.csproj . RUN dotnet restore # Copy source code and publish app COPY --link . . RUN dotnet publish --no-restore -o /app # Runtime stage FROM mcr.microsoft.com/dotnet/runtime:9.0-nanoserver-$TAG WORKDIR /app COPY --link --from=build /app . ENTRYPOINT ["dotnetapp"]