Skip to content

Commit

Permalink
feat: add target arch for Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
WeihanLi committed Feb 26, 2024
1 parent 2b4f3e9 commit 20fe2d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/runtime:9.0-preview-alp
LABEL Maintainer="WeihanLi"

FROM mcr.microsoft.com/dotnet/sdk:9.0-preview-alpine AS build-env

ARG TARGETARCH
WORKDIR /app
COPY ./src/ ./src/
COPY ./build/ ./build/
Expand All @@ -11,7 +11,7 @@ COPY ./Directory.Build.targets ./
COPY ./Directory.Packages.props ./
WORKDIR /app/src/dotnet-exec/
ENV HUSKY=0
RUN dotnet publish -f net9.0 -o /app/artifacts
RUN dotnet publish -f net9.0 -a $TARGETARCH -o /app/artifacts

FROM base AS final
WORKDIR /app
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:9.0-preview-alpi
LABEL Maintainer="WeihanLi"

FROM mcr.microsoft.com/dotnet/sdk:9.0-preview-alpine AS build-env

ARG TARGETARCH
WORKDIR /app
COPY ./src/ ./src/
COPY ./build/ ./build/
Expand All @@ -11,7 +11,7 @@ COPY ./Directory.Build.targets ./
COPY ./Directory.Packages.props ./
WORKDIR /app/src/dotnet-exec/
ENV HUSKY=0
RUN dotnet publish -f net9.0 -o /app/artifacts
RUN dotnet publish -f net9.0 -a $TARGETARCH -o /app/artifacts

FROM base AS final
WORKDIR /app
Expand Down

0 comments on commit 20fe2d3

Please sign in to comment.