From 8c27ff18361c29043f537c15eb5458ffad2370e8 Mon Sep 17 00:00:00 2001 From: Simon Zhu Date: Wed, 4 Mar 2026 04:55:17 -0500 Subject: [PATCH] Fix cross-compilation of native modules in Dockerfile Change builder stage from $BUILDPLATFORM to $TARGETPLATFORM so that native Node.js modules (better-sqlite3) are compiled for the target architecture rather than the build machine's architecture. With $BUILDPLATFORM, cross-compilation scenarios (e.g., arm64 Mac building for amd64 clusters) produce native binaries for the wrong architecture, causing runtime failures. Fixes #65 Co-Authored-By: Claude Opus 4.6 Signed-off-by: Simon Zhu --- mcp/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcp/Dockerfile b/mcp/Dockerfile index 059e71a..9a3cb41 100644 --- a/mcp/Dockerfile +++ b/mcp/Dockerfile @@ -1,5 +1,5 @@ # Build stage -FROM --platform=$BUILDPLATFORM cgr.dev/chainguard/wolfi-base:latest AS builder +FROM --platform=$TARGETPLATFORM cgr.dev/chainguard/wolfi-base:latest AS builder # Import build arguments for cross-compilation ARG BUILDPLATFORM