fix(docker): pin frontend-build to $BUILDPLATFORM to avoid QEMU V8 crash
Multi-arch image builds (linux/amd64,linux/arm64) emulate the foreign arch via QEMU. The unpinned `FROM node:22-slim` frontend-build stage was built per target arch, so Node ran under emulation and V8's baseline JIT crashed (SIGTRAP / exit 133 on `npm ci`) on the CI runner's QEMU. Pin the stage to --platform=$BUILDPLATFORM so the static, arch-independent SPA dist/ is built once on the native build host and COPYd into each arch's runtime stage. Node never runs emulated; both arch images are still produced.
This commit is contained in:
+7
-2
@@ -1,5 +1,10 @@
|
||||
# Stage 1: build the React SPA
|
||||
FROM node:22-slim AS frontend-build
|
||||
# Stage 1: build the React SPA.
|
||||
# Pin to the native build host ($BUILDPLATFORM) so the Node/V8 build never runs
|
||||
# under QEMU during multi-arch builds — emulated Node crashes V8's baseline JIT
|
||||
# (SIGTRAP / exit 133 on `npm ci`). The dist/ output is static JS/CSS, i.e.
|
||||
# architecture-independent, so building it once and COPYing it into each
|
||||
# target-arch runtime stage is both correct and avoids the emulator entirely.
|
||||
FROM --platform=$BUILDPLATFORM node:22-slim AS frontend-build
|
||||
|
||||
WORKDIR /frontend
|
||||
|
||||
|
||||
Reference in New Issue
Block a user