Skip to content

Commit

Permalink
fix dockerfile for multiarch
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelweave committed Apr 25, 2024
1 parent 9ecba52 commit 10c6fec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0.204-cbl-mariner2.0 AS build
# --platform tells docker to always use the host platform for the build not the target platform. Runtime container will use target platform.
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0.204-cbl-mariner2.0 AS build
ARG FHIR_VERSION
ARG ASSEMBLY_VER

Expand Down Expand Up @@ -67,8 +68,9 @@ RUN dotnet restore ./src/Microsoft.Health.Fhir.${FHIR_VERSION}.Web/Microsoft.Hea

COPY . .

RUN dotnet publish /repo/src/Microsoft.Health.Fhir.${FHIR_VERSION}.Web/Microsoft.Health.Fhir.${FHIR_VERSION}.Web.csproj -c Release -o "/build" --no-restore -p:AssemblyVersion="${ASSEMBLY_VER}" -p:FileVersion="${ASSEMBLY_VER}" -p:Version="${ASSEMBLY_VER}" -f net8.0
RUN dotnet publish /repo/src/Microsoft.Health.Fhir.${FHIR_VERSION}.Web/Microsoft.Health.Fhir.${FHIR_VERSION}.Web.csproj -c Release -o "/build" --no-restore -p:AssemblyVersion="${ASSEMBLY_VER}" -p:FileVersion="${ASSEMBLY_VER}" -p:Version="${ASSEMBLY_VER}" -f net8.0 -a $TARGETARCH

# Implicitly uses the target platform for the runtime image.
FROM mcr.microsoft.com/dotnet/aspnet:8.0.4-cbl-mariner2.0 AS runtime

ARG FHIR_VERSION
Expand Down

0 comments on commit 10c6fec

Please sign in to comment.