Skip to content

Commit

Permalink
Improve container building
Browse files Browse the repository at this point in the history
  • Loading branch information
tuokri committed Feb 25, 2024
1 parent 0fa86d9 commit 4bef5a0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim as build-env
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim as build-env
ARG TARGETARCH
WORKDIR /App

COPY . ./
RUN dotnet restore
RUN dotnet publish -c Release --framework net8.0
RUN dotnet restore -a $TARGETARCH
RUN dotnet publish -c Release --framework net8.0 -a $TARGETARCH --no-restore

FROM mcr.microsoft.com/dotnet/runtime:8.0-bookworm-slim

Expand Down

0 comments on commit 4bef5a0

Please sign in to comment.