# Example: .NET 10 runtime image using base-distro # # Usage in accounting-api or route-api: # FROM svrnty/base-distro:dotnet-sdk-latest AS build # ... (build stage with .NET SDK installed on top) ... # # FROM svrnty/base-distro:dotnet-runtime-latest AS final # COPY --from=build /app . # ENTRYPOINT ["dotnet", "MyApp.dll"] # Build stage: use the SDK base + install .NET SDK FROM svrnty/base-distro:dotnet-sdk-latest AS build # Install .NET 10 SDK (not yet in Wolfi, manual tarball install) USER root RUN curl -fsSL "https://dotnetcli.azureedge.net/dotnet/Sdk/10.0.100/dotnet-sdk-10.0.100-linux-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" \ -o /tmp/dotnet-sdk.tar.gz && \ mkdir -p /usr/share/dotnet && \ tar xf /tmp/dotnet-sdk.tar.gz -C /usr/share/dotnet && \ ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet && \ rm /tmp/dotnet-sdk.tar.gz WORKDIR /source COPY . . RUN dotnet publish -o /app # Runtime stage: minimal base + .NET runtime only FROM svrnty/base-distro:dotnet-runtime-latest AS final # Install .NET 10 ASP.NET runtime USER root RUN curl -fsSL "https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/10.0.0/aspnetcore-runtime-10.0.0-linux-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" \ -o /tmp/aspnet-runtime.tar.gz && \ mkdir -p /usr/share/dotnet && \ tar xf /tmp/aspnet-runtime.tar.gz -C /usr/share/dotnet && \ ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet && \ rm /tmp/aspnet-runtime.tar.gz WORKDIR /app COPY --from=build /app . USER 65532 ENTRYPOINT ["dotnet", "MyApp.dll"]