Skip to content

Commit

Permalink
Fix cross platform build on alpine sample (#4958)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussell authored Oct 24, 2023
1 parent a8e1aa1 commit 8fc28db
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions samples/aspnetapp/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
ARG TARGETARCH
WORKDIR /source

# optimize
RUN --mount=type=bind,source=aspnetapp/aspnetapp.csproj,target=aspnetapp.csproj \
--mount=type=cache,target=/root/.nuget/ \
dotnet restore -a $TARGETARCH
# copy csproj and restore as distinct layers
COPY aspnetapp/*.csproj .
RUN dotnet restore -a $TARGETARCH

# copy and publish app and libraries
COPY aspnetapp/. .
RUN dotnet publish -a $TARGETARCH -o /app
RUN dotnet publish --no-restore -a $TARGETARCH -o /app


# Enable globalization and time zones:
Expand Down

0 comments on commit 8fc28db

Please sign in to comment.