fix(docker): build on Linux ARM64 and include mcp/ module - #9328
Open
aguanitallc wants to merge 1 commit into
Open
fix(docker): build on Linux ARM64 and include mcp/ module#9328aguanitallc wants to merge 1 commit into
aguanitallc wants to merge 1 commit into
Conversation
1. Add build-essential + python3 so native modules (better-sqlite3) can compile. 2. Compile better-sqlite3 from source: the shipped linux-arm64 prebuild needs glibc 2.38, but node:22-slim (Debian bookworm) ships 2.36, so it fails to load at runtime. 3. COPY mcp/ so the persistence plugin can load (lib/cookies.js imports /app/mcp/lib/cookies.mjs).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Docker image fails to build and run on Linux ARM64 (aarch64) hosts (e.g. Oracle Ampere, Raspberry Pi):
better-sqlite3fails at runtime — the shipped prebuildify binaryprebuilds/linux-arm64.nodeis linked against glibc 2.38, but thenode:22-slimbase (Debian bookworm) ships glibc 2.36, so loading it throwsGLIBC_2.38 not found.node:22-slimhas nomake/g++, so even when the prebuild doesn't match,node-gypcan't compile a fallback.mcp/is not copied —lib/cookies.jsimports/app/mcp/lib/cookies.mjs, but the Dockerfile neverCOPY mcp/, so thepersistenceplugin fails to load withERR_MODULE_NOT_FOUND.Fix
build-essential+python3to the base image.better-sqlite3's prebuilds and compile from source (npm run build-release) against the container's own glibc, so the native module always matches the target platform.COPY mcp/ ./mcp/.Testing
Built and ran on Linux aarch64 (Oracle Ampere):
camoufox launchedcleanly (no glibc error).POST /tabs+GET /tabs/:id/snapshotreturned real page content with element refs.persistenceplugin loads without error.