Merge pull request #2423 from caprover/copilot/fix-build-publish-docker-hub
Run build / build (push) Canceled after 0s
Run formatter / check-code-formatting (push) Canceled after 0s
Run lint / run-lint (push) Canceled after 0s
Build and push the edge image / run-pre-checks (push) Canceled after 0s
Build and push the edge image / build-publish-docker-hub (push) Canceled after 0s

Fix arm64/arm multi-arch Docker builds failing with SIGILL (exit code 132) on Node.js 22
This commit is contained in:
Kasra Bigdeli
2026-07-19 20:35:13 -07:00
committed by GitHub
2 changed files with 21 additions and 6 deletions
+10 -3
View File
@@ -1,10 +1,10 @@
FROM node:22-alpine
RUN apk add --update --no-cache make gcc g++ git curl openssl openssh
# Build stage runs on the host platform to avoid QEMU SIGILL issues with Node.js 22 on arm64
FROM --platform=$BUILDPLATFORM node:22-alpine AS builder
RUN apk add --update --no-cache make gcc g++ git curl openssl
WORKDIR /usr/src/app
COPY . ./
# Build backend code
RUN npm ci && \
npm run build && \
@@ -12,6 +12,13 @@ RUN npm ci && \
npm cache clean --force && \
mv ./edge-override.json ./config-override.json
# Final stage uses the target platform's Node.js runtime
FROM node:22-alpine
RUN apk add --update --no-cache git curl openssl openssh
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app .
# This quick hack invalidates the cache.
ADD https://www.google.com /time.now
+11 -3
View File
@@ -1,5 +1,6 @@
FROM node:22-alpine
RUN apk add --update --no-cache make gcc g++ git curl openssl openssh
# Build stage runs on the host platform to avoid QEMU SIGILL issues with Node.js 22 on arm64
FROM --platform=$BUILDPLATFORM node:22-alpine AS builder
RUN apk add --update --no-cache make gcc g++ git curl openssl
WORKDIR /usr/src/app
COPY . ./
@@ -9,7 +10,14 @@ RUN npm ci && \
npm run build && \
npm ci --omit=dev && \
npm cache clean --force
# Final stage uses the target platform's Node.js runtime
FROM node:22-alpine
RUN apk add --update --no-cache git curl openssl openssh
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app .
ENV NODE_ENV production
ENV PORT 3000
EXPOSE 3000