diff --git a/.github/workflows/push_docker_image.yml b/.github/workflows/push_docker_image.yml index 90bde4c02..bd0911e71 100644 --- a/.github/workflows/push_docker_image.yml +++ b/.github/workflows/push_docker_image.yml @@ -53,14 +53,16 @@ jobs: docker build . \ -f ${{ matrix.docker.dockerfile }}.amd64 \ -t ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 \ - --build-arg COMMIT=git-${{ github.sha }} + --build-arg COMMIT=git-${{ github.sha }} \ + --build-arg TARGETPLATFORM=linux/amd64 docker push ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 - name: build-and-push-arm64v8 run: | docker build . \ -f ${{ matrix.docker.dockerfile }}.arm64v8 \ -t ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 \ - --build-arg COMMIT=git-${{ github.sha }} + --build-arg COMMIT=git-${{ github.sha }} \ + --build-arg TARGETPLATFORM=linux/arm64 docker push ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 - name: merge-manifest-and-push run: | diff --git a/Dockerfile b/Dockerfile index 6e03a4942..cea86d51d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /app ARG COMMIT +ARG TARGETPLATFORM # Copy csproj and restore as distinct layers COPY ./Lib9c/Lib9c/Lib9c.csproj ./Lib9c/ @@ -16,23 +17,40 @@ RUN dotnet restore NineChronicles.Headless.Executable # Copy everything else and build COPY . ./ -RUN dotnet publish NineChronicles.Headless.Executable/NineChronicles.Headless.Executable.csproj \ +RUN <