diff --git a/Dockerfile b/Dockerfile index a5b52b2..d032813 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /app # Copy everything else and build COPY . ./ +RUN dotnet restore # Build with platform-specific .Net RID RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ @@ -23,7 +24,7 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ #RUN dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /app COPY --from=build-env /app/out . ENTRYPOINT ["dotnet", "fhir-candle.dll"]