Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions examples/net8.0/aspnetcore/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ 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@sha256:f516a25cab5c5359fa0fe694e024e643a97d8b677a68322571c48916581c393f AS final
WORKDIR /app
EXPOSE 8080
USER $APP_UID

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