| 1234567891011121314151617181920212223242526272829303132 | # because of dotnet, we always build on amd64, and target platforms in cli# dotnet doesn't support QEMU for building or running. # (errors common in arm/v7 32bit) https://github.com/dotnet/dotnet-docker/issues/1537# https://hub.docker.com/_/microsoft-dotnet# hadolint ignore=DL3029FROM --platform=${BUILDPLATFORM} mcr.microsoft.com/dotnet/sdk:7.0 as buildARG TARGETPLATFORMARG BUILDPLATFORMRUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"WORKDIR /sourceCOPY *.csproj .RUN case ${TARGETPLATFORM} in \         "linux/amd64")  ARCH=x64  ;; \         "linux/arm64")  ARCH=arm64  ;; \         "linux/arm/v7") ARCH=arm  ;; \    esac \    && dotnet restore -r linux-${ARCH}COPY . .RUN  case ${TARGETPLATFORM} in \         "linux/amd64")  ARCH=x64  ;; \         "linux/arm64")  ARCH=arm64  ;; \         "linux/arm/v7") ARCH=arm  ;; \    esac \    && dotnet publish -c release -o /app -r linux-${ARCH} --self-contained false --no-restore# app imageFROM mcr.microsoft.com/dotnet/runtime:7.0WORKDIR /appCOPY --from=build /app .ENTRYPOINT ["dotnet", "Worker.dll"]
 |