From b9fab85e37ce195b080e5e8c7ff001ecb5364280 Mon Sep 17 00:00:00 2001 From: wangjichao Date: Wed, 22 Apr 2026 00:48:52 +0800 Subject: [PATCH 1/3] fix(docker): switch Dockerfile.cli from Alpine to Debian slim Alpine uses musl libc which is incompatible with @ladybugdb/core's glibc-compiled native binary, causing ERR_DLOPEN_FAILED on startup. Closes #1008 --- Dockerfile.cli | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile.cli b/Dockerfile.cli index d1d4f45a4c..7d9bfedad2 100644 --- a/Dockerfile.cli +++ b/Dockerfile.cli @@ -4,12 +4,12 @@ ARG TARGETPLATFORM # ── Builder ──────────────────────────────────────────────────────────── # Native modules (tree-sitter-*, onnxruntime-node, node-gyp builds for # tree-sitter-proto / tree-sitter-swift) require python3 + a C/C++ toolchain. -FROM node:22-alpine AS builder +FROM node:22-slim AS builder WORKDIR /app # Toolchain for node-gyp / native builds. -RUN apk add --no-cache python3 make g++ git +RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ git && rm -rf /var/lib/apt/lists/* # Build gitnexus-shared first — gitnexus depends on it as a workspace. COPY gitnexus-shared/package.json gitnexus-shared/package-lock.json ./gitnexus-shared/ @@ -28,10 +28,10 @@ RUN npm ci --prefix gitnexus RUN npm prune --omit=dev --prefix gitnexus # ── Runtime ──────────────────────────────────────────────────────────── -FROM node:22-alpine AS runtime +FROM node:22-slim AS runtime # curl for the healthcheck; git so `gitnexus` can clone repos at runtime. -RUN apk add --no-cache curl git +RUN apt-get update && apt-get install -y --no-install-recommends curl git && rm -rf /var/lib/apt/lists/* WORKDIR /app From e41a4cbfb1e67c20f15970f515f97fc3d9bfe5d5 Mon Sep 17 00:00:00 2001 From: wangjichao Date: Wed, 22 Apr 2026 03:33:59 +0800 Subject: [PATCH 2/3] fix(docker): resolve build and runtime failures in Dockerfile.cli - Add **/*.tsbuildinfo to .dockerignore and rm -f tsbuildinfo in builder to prevent stale incremental cache from skipping gitnexus-shared compilation - Install libstdc++6 from Debian Trixie for @ladybugdb/core native module compatibility (requires GLIBCXX_3.4.31) --- .dockerignore | 2 ++ Dockerfile.cli | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/.dockerignore b/.dockerignore index e09631a0aa..4a2866b8eb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -14,6 +14,8 @@ coverage .env.local .env.*.local +**/*.tsbuildinfo + .gitnexus gitnexus-web/playwright-report gitnexus-web/test-results diff --git a/Dockerfile.cli b/Dockerfile.cli index 7d9bfedad2..87842f6357 100644 --- a/Dockerfile.cli +++ b/Dockerfile.cli @@ -15,6 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends python3 make g+ COPY gitnexus-shared/package.json gitnexus-shared/package-lock.json ./gitnexus-shared/ RUN npm ci --prefix gitnexus-shared COPY gitnexus-shared ./gitnexus-shared +RUN rm -f gitnexus-shared/tsconfig.tsbuildinfo RUN npm run build --prefix gitnexus-shared # Copy the full gitnexus package before installing — `npm ci` triggers @@ -30,6 +31,14 @@ RUN npm prune --omit=dev --prefix gitnexus # ── Runtime ──────────────────────────────────────────────────────────── FROM node:22-slim AS runtime +# @ladybugdb/core needs GLIBCXX_3.4.31 (GCC 13+); Bookworm only ships 3.4.30. +# Pull libstdc++6 from Debian Trixie, then remove the source list so later +# packages (curl, git) still come from stable Bookworm. +RUN echo "deb http://deb.debian.org/debian trixie main" > /etc/apt/sources.list.d/trixie.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends -t trixie libstdc++6 && \ + rm /etc/apt/sources.list.d/trixie.list + # curl for the healthcheck; git so `gitnexus` can clone repos at runtime. RUN apt-get update && apt-get install -y --no-install-recommends curl git && rm -rf /var/lib/apt/lists/* From a8bbddb671bb2c7c5353b2fb80a600a7d79dfac5 Mon Sep 17 00:00:00 2001 From: wangjichao Date: Wed, 22 Apr 2026 04:06:15 +0800 Subject: [PATCH 3/3] fix(docker): use node:22-trixie-slim for GLIBCXX_3.4.31 support Replaces the manual Trixie libstdc++6 backport with the official node:22-trixie-slim base image, which ships GCC 14 runtime natively. --- Dockerfile.cli | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Dockerfile.cli b/Dockerfile.cli index 87842f6357..c45292e064 100644 --- a/Dockerfile.cli +++ b/Dockerfile.cli @@ -4,7 +4,7 @@ ARG TARGETPLATFORM # ── Builder ──────────────────────────────────────────────────────────── # Native modules (tree-sitter-*, onnxruntime-node, node-gyp builds for # tree-sitter-proto / tree-sitter-swift) require python3 + a C/C++ toolchain. -FROM node:22-slim AS builder +FROM node:22-trixie-slim AS builder WORKDIR /app @@ -29,15 +29,7 @@ RUN npm ci --prefix gitnexus RUN npm prune --omit=dev --prefix gitnexus # ── Runtime ──────────────────────────────────────────────────────────── -FROM node:22-slim AS runtime - -# @ladybugdb/core needs GLIBCXX_3.4.31 (GCC 13+); Bookworm only ships 3.4.30. -# Pull libstdc++6 from Debian Trixie, then remove the source list so later -# packages (curl, git) still come from stable Bookworm. -RUN echo "deb http://deb.debian.org/debian trixie main" > /etc/apt/sources.list.d/trixie.list && \ - apt-get update && \ - apt-get install -y --no-install-recommends -t trixie libstdc++6 && \ - rm /etc/apt/sources.list.d/trixie.list +FROM node:22-trixie-slim AS runtime # curl for the healthcheck; git so `gitnexus` can clone repos at runtime. RUN apt-get update && apt-get install -y --no-install-recommends curl git && rm -rf /var/lib/apt/lists/*