Dockerfile: fix two independent aarch64 build/runtime failures - #9329
Open
ibrahiem9 wants to merge 1 commit into
Open
Dockerfile: fix two independent aarch64 build/runtime failures#9329ibrahiem9 wants to merge 1 commit into
ibrahiem9 wants to merge 1 commit into
Conversation
The image cannot be built or run on arm64 today. Two independent defects stack, so fixing either one alone still leaves the other: 1. Build time, every Debian release: `npm ci` finds no better-sqlite3 prebuild matching this node/arch and falls back to `node-gyp rebuild`, which dies with `Error: not found: make` because node:*-slim carries no toolchain. Install build-essential + python3 and purge them in the same layer so nothing lands in the final image. 2. Runtime, bookworm only: better-sqlite3's bundled prebuilds/linux-arm64.node is linked against GLIBC_2.38, but bookworm ships 2.36. The module loads fine at startup and throws `ERR_DLOPEN_FAILED ... version 'GLIBC_2.38' not found` on the first tab open. node:22-trixie-slim ships glibc 2.41, which satisfies it. Forcing a source build instead (npm_config_build_from_source) does not help -- the loader prefers the bundled prebuilds/<platform>-<arch>.node file over build/Release. The trixie move also renames one package: libegl1-mesa is dropped in trixie and is now just libegl1. libgl1-mesa-dri, libgbm1 and libasound2 are unchanged. Tested on linux/arm64 only: image builds clean and Camoufox reports browserConnected with live tabs. amd64 is unaffected by (2) -- its prebuild targets an older glibc -- so for amd64 this is a base-image bump plus the toolchain fix from (1). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The image can't be built or run on
linux/arm64today. Two independent defects stack, so fixing either one alone still fails — I spent a couple of builds thinking I'd found "the" root cause before realising there were two.1. Build time — fails on any Debian release
npm ci --omit=devfinds nobetter-sqlite3prebuild matching this node/arch and falls back tonode-gyp rebuild, which dies onnode:*-slim:Fix: install
build-essential+python3, run the install, and purge them in the same layer so the toolchain doesn't land in the final image.2. Runtime — bookworm only, and it doesn't fail at startup
better-sqlite3ships a bundledprebuilds/linux-arm64.nodelinked againstGLIBC_2.38. Bookworm ships 2.36. The module resolves fine, the server starts and reports healthy, and then the first tab open throws:node:22-trixie-slimships glibc 2.41, which satisfies it.Worth noting for anyone who tries the obvious workaround first:
npm_config_build_from_source=true+npm rebuild --build-from-sourcedoes not fix this. The loader prefers the bundledprebuilds/<platform>-<arch>.nodefile over anything inbuild/Release/, and the forced build left.deps+obj.targetbehind with no linked.node— a half-build that looks like a build. Matching the glibc is the reliable fix; the alternative isrm -rf node_modules/better-sqlite3/prebuilds, which felt more invasive than a base bump.Package rename that comes with trixie
libegl1-mesais dropped in trixie — it'slibegl1now.libgl1-mesa-dri,libgbm1andlibasound2are unchanged (no t64 churn on these).What I tested
linux/arm64only, on Amazon Linux 2023 / aarch64:/healthreturns{"ok":true,"engine":"camoufox","browserConnected":true,"browserRunning":true,"activeTabs":2,...}with tabs actually open — i.e. past the point where defect 2 used to throw.ldd --versionin the image reports2.41, andlibEGL.so.1is present.I have not built or run this on amd64. amd64 is unaffected by defect 2 (its prebuild targets an older glibc), so for amd64 this change is a base-image bump plus the toolchain fix from defect 1. If you'd rather not move the base image for everyone, the alternative is a conditional on
TARGETARCH— happy to rework it that way, or to split the two fixes into separate commits if that's easier to review.