Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
context: ../..
dockerfile: examples/net8.0/aspnetcore/Dockerfile
args:
DOTNET_PUBLISH_ARGS: "--self-contained true /p:PublishSingleFile=true /p:BuildDistroFromSource=${BUILD_DISTRO_FROM_SOURCE:-true}"
DOTNET_PUBLISH_ARGS: "/p:PublishSingleFile=true /p:BuildDistroFromSource=${BUILD_DISTRO_FROM_SOURCE:-true}"
entrypoint: ./aspnetcore
environment:
- AWS_ACCESS_KEY_ID=localstack
Expand Down
7 changes: 5 additions & 2 deletions examples/net8.0/aspnetcore/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ WORKDIR /source
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages \
dotnet publish "examples/net8.0/aspnetcore/aspnetcore.csproj" --arch "${TARGETARCH}" --configuration "${CONFIGURATION}" --output /app ${DOTNET_PUBLISH_ARGS}
dotnet publish "examples/net8.0/aspnetcore/aspnetcore.csproj" --arch "${TARGETARCH}" --configuration "${CONFIGURATION}" --output /app --self-contained true ${DOTNET_PUBLISH_ARGS}

FROM mcr.microsoft.com/dotnet/aspnet:8.0.20-noble-chiseled-extra@sha256:e396ddb631cb148b3db17b8a464e2a306f4e802381c14e779362fb44aeb3cf5c AS final
FROM mcr.microsoft.com/dotnet/runtime:8.0.20-azurelinux3.0-distroless-extra@sha256:46fedd5b7a7713ba96a27b1744317b34ea89f93d408becef4fc6c129283f6e36 AS final
WORKDIR /app
EXPOSE 8080
USER $APP_UID

ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

COPY --from=build /app .
ENTRYPOINT ["dotnet", "aspnetcore.dll"]
Loading