From 44df30236e6c5a730437ff5583ef4057f7708a6f Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Wed, 22 Jul 2026 20:11:28 -0400 Subject: [PATCH] fix(docker-dev): pin the build stage to linux/amd64 so Grpc.Tools protoc runs Phase 3 added an in-repo .proto compiled by Grpc.Tools; its bundled linux_arm64 protoc segfaults (exit 139) on Apple-Silicon Docker, so the native-arm64 build stage could not generate the gRPC stubs. dotnet publish is framework-dependent (portable IL + every RID's native assets), so pinning ONLY the build stage to linux/amd64 leaves the runtime image native arm64 (fast) while the one-time build is emulated. Matches the Dockerfile's stated 'targeting linux-x64' intent. Claude-Session: https://claude.ai/code/session_01GASWkNEi68FSCtvr6rLoEW --- docker-dev/Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker-dev/Dockerfile b/docker-dev/Dockerfile index 15ec7781..e7c06897 100644 --- a/docker-dev/Dockerfile +++ b/docker-dev/Dockerfile @@ -3,7 +3,12 @@ # Compose drives OTOPCUA_ROLES + Cluster:* env per container to differentiate them. # A separate `migrator` stage (below) applies EF migrations once on bring-up. -FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build +# Build stage is PINNED to linux/amd64. Per-cluster mesh Phase 3 added an in-repo .proto compiled by +# Grpc.Tools, whose bundled linux_arm64 `protoc` segfaults (exit 139) on Apple-Silicon Docker — so a +# native-arm64 build stage cannot generate the gRPC stubs. `dotnet publish` here is framework-dependent +# (portable IL + every RID's native assets), so the amd64-built output runs unchanged on the native +# runtime image below; only this one-time build is emulated, runtime stays native/fast. +FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:10.0 AS build WORKDIR /src COPY . . RUN dotnet restore ZB.MOM.WW.OtOpcUa.slnx