Skip to content

Commit

Permalink
Add architecture support to Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
urumo committed Oct 14, 2024
1 parent e516a08 commit 6e600c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Argon.Api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base
ARG TARGETARCH
USER $APP_UID
WORKDIR /app
EXPOSE 8080
Expand All @@ -9,10 +10,10 @@ ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["src/Argon.Api/Argon.Api.csproj", "src/Argon.Api/"]
COPY ["src/ServiceDefaults/ServiceDefaults.csproj", "src/ServiceDefaults/"]
RUN dotnet restore "src/Argon.Api/Argon.Api.csproj"
RUN dotnet restore "src/Argon.Api/Argon.Api.csproj" -a $TARGETARCH
COPY . .
WORKDIR "/src/src/Argon.Api"
RUN dotnet build "Argon.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
RUN dotnet build "Argon.Api.csproj" -c $BUILD_CONFIGURATION -a $TARGETARCH -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
Expand Down

0 comments on commit 6e600c6

Please sign in to comment.