Skip to content

Commit

Permalink
Set Dockerfile to use TARGETARCH
Browse files Browse the repository at this point in the history
  • Loading branch information
GinoCanessa committed Aug 30, 2024
1 parent 3718d0c commit 943a41b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
ARG TARGETPLATFORM
ARG BUILDPLATFORM
#RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log
ARG TARGETARCH

WORKDIR /app

# Copy everything else and build
COPY . ./

RUN dotnet restore -a $TARGETARCH src/fhir-candle/fhir-candle.csproj
#RUN dotnet build -a $TARGETARCH src/fhir-candle/fhir-candle.csproj -c Release -o out
RUN dotnet publish -a $TARGETARCH src/fhir-candle/fhir-candle.csproj -c Release -o out

#
## Build with platform-specific .Net RID
#RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
Expand Down Expand Up @@ -34,8 +40,9 @@ COPY . ./
#fi;

#RUN dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0;
RUN dotnet restore src/fhir-candle/fhir-candle.csproj
RUN dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out
#RUN dotnet restore src/fhir-candle/fhir-candle.csproj
#RUN dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out


# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0
Expand Down

0 comments on commit 943a41b

Please sign in to comment.