Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
build for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
JensDll committed May 26, 2023
1 parent 2b77632 commit 8d55557
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
build-args: |
DOMAIN=steganography.app
platforms: |
linux/amd64
linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/steganography:web.latest,
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
# Build sometimes fails on ARM
# https://github.com/NuGet/Home/issues/12227
platforms: |
linux/amd64
linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/steganography:api.latest,
Expand Down
6 changes: 4 additions & 2 deletions services/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0.302-alpine3.17 as build

ARG TARGETARCH

WORKDIR /build

# Copy csproj and restore as distinct layers
COPY src/Domain/Domain.csproj ./Domain/
COPY src/WebApi/WebApi.csproj ./WebApi/

RUN dotnet restore --runtime linux-x64 ./WebApi/WebApi.csproj
RUN dotnet restore --arch $TARGETARCH ./WebApi/WebApi.csproj

# Copy everything else and build
COPY src/Domain ./Domain/
COPY src/WebApi ./WebApi/

WORKDIR /build/WebApi

RUN dotnet publish --configuration Release --runtime linux-x64 \
RUN dotnet publish --configuration Release --arch $TARGETARCH \
--no-self-contained --output /app --no-restore

# Final image
Expand Down

0 comments on commit 8d55557

Please sign in to comment.