Skip to content

Commit

Permalink
Publish to specific arch in docker images.
Browse files Browse the repository at this point in the history
  • Loading branch information
GinoCanessa committed Aug 30, 2024
1 parent 81cff8a commit 6db0d82
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@ WORKDIR /app

# Copy everything else and build
COPY . ./
RUN dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out

# Build with platform-specific .Net RID
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --arch linux-x64; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --arch linux-arm64; \
elif [ "$TARGETPLATFORM" = "windows/x64" ]; then \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --arch win-x64; \
elif [ "$TARGETPLATFORM" = "windows/arm64" ]; then \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --arch win-arm64; \
elif [ "$TARGETPLATFORM" = "darwin/x64" ]; then \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --arch osx-x64; \
elif [ "$TARGETPLATFORM" = "darwin/arm64" ]; then \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --arch osx-arm64; \
else \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out; \
fi;
#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 6db0d82

Please sign in to comment.