fix(core): Rebuild isolated-vm in Docker image for musl libc (#31396)

This commit is contained in:
Danny Martini 2026-06-01 10:23:51 +02:00 committed by GitHub
parent 55a96070c6
commit 80a97bdcf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,16 @@ FROM node:${NODE_VERSION}-alpine3.22 AS builder
COPY ./compiled /usr/local/lib/node_modules/n8n
RUN apk add --no-cache python3 make g++ && \
cd /usr/local/lib/node_modules/n8n && \
npm rebuild sqlite3
npm rebuild sqlite3 && \
# Rebuild isolated-vm from source. node-gyp-build's musl detection relies
# on /etc/alpine-release which DHI Alpine omits, so the bundled prebuilt
# loader picks the glibc binary and segfaults in musl pthread paths.
# Removing prebuilds and invoking node-gyp directly avoids npm rebuild's
# double-build behavior (built-in node-gyp + install-script node-gyp)
# which races on dep-file state.
rm -rf node_modules/isolated-vm/prebuilds && \
cd node_modules/isolated-vm && \
npx --yes node-gyp rebuild --release -j max
FROM n8nio/base:${NODE_VERSION}