Skip to content

Commit 7618dc4

Browse files
syn-zhuclaude
andauthored
Fix cross-compilation of native modules in Dockerfile (#66)
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 Signed-off-by: Simon Zhu <simon.zhu@mongodb.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d77c3c3 commit 7618dc4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mcp/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM --platform=$BUILDPLATFORM cgr.dev/chainguard/wolfi-base:latest AS builder
2+
FROM --platform=$TARGETPLATFORM cgr.dev/chainguard/wolfi-base:latest AS builder
33

44
# Import build arguments for cross-compilation
55
ARG BUILDPLATFORM

0 commit comments

Comments
 (0)