# Use a multi-stage build to compile and package the Electron-based desktop app FROM node:lts-bookworm AS builder # Install required build dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential python3 gcc g++ make \ libx11-dev libxkbfile-dev libsecret-1-dev libxss1 libnss3 \ libatk-bridge2.0-0 libatk1.0-0 libgtk-3-0 libasound2 \ ca-certificates curl \ && rm -rf /var/lib/apt/lists/* WORKDIR /workspace # Copy package manifests first to leverage Docker layer caching COPY package.json bun.lock bun.lockb ./ # Install dependencies RUN npm ci # Copy the full source code COPY . . # Build the project and package artifacts RUN npm run build RUN npm run dist # Final runtime image FROM node:lts-bookworm # Install runtime dependencies (mirrors build dependencies, kept for compatibility with Electron apps) RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential python3 gcc g++ make \ libx11-dev libxkbfile-dev libsecret-1-dev libxss1 libnss3 \ libatk-bridge2.0-0 libatk1.0-0 libgtk-3-0 libasound2 \ ca-certificates curl \ && rm -rf /var/lib/apt/lists/* # Copy built artifacts from the builder stage COPY --from=builder /workspace/release /app WORKDIR /app # Entrypoint script to locate and run the produced AppImage RUN bash -lc 'set -e; APP_IMAGE=$(find /app -name "*.AppImage" 2>/dev/null | head -n1); if [ -z "$APP_IMAGE" ]; then echo "No AppImage found in /app"; else echo "Found AppImage: $APP_IMAGE"; fi' # Create a small entrypoint that launches the AppImage if present RUN bash -lc 'cat > /entrypoint.sh <<"EOF" #!/usr/bin/env bash set -e APP_IMAGE=$(find /app -name "*.AppImage" 2>/dev/null | head -n1) if [ -z "$APP_IMAGE" ]; then echo "No AppImage found in /app" exit 1 fi chmod +x "$APP_IMAGE" 2>/dev/null || true exec "$APP_IMAGE" "$@" EOF chmod +x /entrypoint.sh' ENTRYPOINT ["/entrypoint.sh"]
# Ignore unnecessary files for Docker builds .git node_modules bun.lock bun.lockb dist release build coverage npm-debug.log* .yarn-cache .DS_Store
#0 building with "default" instance using docker driver #1 [internal] load build definition from Dockerfile #1 transferring dockerfile: 1.95kB done #1 DONE 0.1s Dockerfile:49 -------------------- 47 | RUN bash -lc 'cat > /entrypoint.sh <<"EOF" 48 | #!/usr/bin/env bash 49 | >>> set -e 50 | APP_IMAGE=$(find /app -name "*.AppImage" 2>/dev/null | head -n1) 51 | if [ -z "$APP_IMAGE" ]; then -------------------- ERROR: failed to build: failed to solve: dockerfile parse error on line 49: unknown instruction: set (did you mean user?)
# Use a multi-stage build to compile and package the Electron-based desktop app FROM node:lts-bookworm AS builder # Install required build dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential python3 gcc g++ make \ libx11-dev libxkbfile-dev libsecret-1-dev libxss1 libnss3 \ libatk-bridge2.0-0 libatk1.0-0 libgtk-3-0 libasound2 \ ca-certificates curl \ && rm -rf /var/lib/apt/lists/* WORKDIR /workspace # Copy package manifests first to leverage Docker layer caching COPY package.json bun.lock bun.lockb ./ # Install dependencies RUN npm ci # Copy the full source code COPY . . # Build the project and package artifacts RUN npm run build RUN npm run dist # Final runtime image FROM node:lts-bookworm # Install runtime dependencies (mirrors build dependencies, kept for compatibility with Electron apps) RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential python3 gcc g++ make \ libx11-dev libxkbfile-dev libsecret-1-dev libxss1 libnss3 \ libatk-bridge2.0-0 libatk1.0-0 libgtk-3-0 libasound2 \ ca-certificates curl \ && rm -rf /var/lib/apt/lists/* # Copy built artifacts from the builder stage COPY --from=builder /workspace/release /app WORKDIR /app # Entrypoint to run AppImage if present ENTRYPOINT ["bash", "-lc", "APP_IMAGE=$(find /app -name '*.AppImage' 2>/dev/null | head -n1); if [ -z \"$APP_IMAGE\" ]; then echo 'No AppImage found in /app'; exit 1; fi; chmod +x "$APP_IMAGE" 2>/dev/null || true; exec "$APP_IMAGE" \"$@\""]
Concise summary of the Docker build error - Exact error message (and exit code): ERROR: failed to calculate checksum of ref mqpnlh3la2bzegxdamkvycc7g::oyxgubnyfp1xxg9ou00mymq30: "/bun.lock": not found (Exit code not shown in the output) - Failing command/step: [builder 4/8] COPY package.json bun.lock bun.lockb ./ - Missing files / files excluded: - The error refers to "/bun.lock" not found. - Warnings indicate bun.lock and bun.lockb are excluded by .dockerignore (line 15), which prevents them from being copied. - Version mismatch / base image info: - Base image used: node:lts-bookworm with an explicit digest: sha256:5a593d74b632d1c6f816457477b6819760e13624455d587eef0fa418c8d0777b - The issue is not a version mismatch, but a missing/ignored bun.lock files in the build context. - Context and potential fixes: - Ensure bun.lock and bun.lockb exist in the build context and are not excluded by .dockerignore (line 15) or adjust the Dockerfile to avoid copying them if not needed. - Alternatively generate bun.lock before the COPY step (e.g., run bun install) or remove bun.lock/bun.lockb from the COPY if appropriate.
# Ignore unnecessary files for Docker builds .git node_modules # bun.lock and bun.lockb can be used for deterministic bun/npm installation; include them if present # bun.lock # bun.lockb # dist release build coverage npm-debug.log* .yarn-cache .DS_Store
# Use a multi-stage build to compile and package the Electron-based desktop app FROM node:lts-bookworm AS builder # Install required build dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential python3 gcc g++ make \ libx11-dev libxkbfile-dev libsecret-1-dev libxss1 libnss3 \ libatk-bridge2.0-0 libatk1.0-0 libgtk-3-0 libasound2 \ ca-certificates curl \ && rm -rf /var/lib/apt/lists/* WORKDIR /workspace # Copy package manifests first to leverage Docker layer caching COPY package.json bun.lock bun.lockb ./ # Install dependencies RUN npm ci # Copy the full source code COPY . . # Build the project and package artifacts RUN npm run build RUN npm run dist # Final runtime image FROM node:lts-bookworm # Install runtime dependencies (mirrors build dependencies, kept for compatibility with Electron apps) RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential python3 gcc g++ make \ libx11-dev libxkbfile-dev libsecret-1-dev libxss1 libnss3 \ libatk-bridge2.0-0 libatk1.0-0 libgtk-3-0 libasound2 \ ca-certificates curl \ && rm -rf /var/lib/apt/lists/* # Copy built artifacts from the builder stage COPY --from=builder /workspace/release /app WORKDIR /app # Entrypoint to run AppImage if present ENTRYPOINT ["bash", "-lc", "APP_IMAGE=$(find /app -name '*.AppImage' 2>/dev/null | head -n1); if [ -z \"$APP_IMAGE\" ]; then echo 'No AppImage found in /app'; exit 1; fi; chmod +x "$APP_IMAGE" 2>/dev/null || true; exec "$APP_IMAGE" \"$@\""]
Summary of Docker build error (concise, with actionable items) - Failing command/step: [builder 5/8] RUN npm ci - Exact error message and exit code: The npm error message: The `npm ci` command can only install with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate a package-lock.json file, then try again. A complete log of this run can be found in: /root/.npm/_logs/2026-03-18T23_50_03_959Z-debug-0.log Final Docker/Build error: ERROR: process "/bin/sh -c npm ci" did not complete successfully: exit code: 1 - Missing packages/files mentioned: - No existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1 found for npm ci to use. - Version mismatch / guidance: - The error implies a lockfile is required and suggests using npm@5 or later to generate a package-lock.json. No actual version mismatch is shown, but a missing lockfile is preventing npm ci from running. Ensure a valid package-lock.json (lockfileVersion >= 1) exists by running npm install with a modern npm, then retry npm ci.
- Project: 21st-desktop, v0.0.72. Description: 1Code UI for parallel work with AI agents. Main entry: out/main/index.js. Homepage: https://21st.dev. Author: 21st.dev.
- Key scripts:
- dev: electron-vite dev
- build: electron-vite build
- preview: electron-vite preview
- package: electron-builder --dir
- package:mac: electron-builder --mac
- package:win: electron-builder --win
- package:linux: electron-builder --linux
- dist: electron-builder
- dist:manifest: node scripts/generate-update-manifest.mjs
- dist:upload: node scripts/upload-release.mjs
- claude:download: node scripts/download-claude-binary.mjs --version=2.1.45
- claude:download:all: ... --version=2.1.45 --all
- codex:download: node scripts/download-codex-binary.mjs --version=0.98.0
- codex:download:all: ... --version=0.98.0 --all
- release: rm -rf release && bun i && bun run claude:download && bun run codex:download && bun run build && bun run package:mac && bun run dist:manifest && ./scripts/upload-release-wrangler.sh
- release:dev: rm -rf release && bun run claude:download && bun run codex:download && bun run build && bun run package:mac && rm -rf node_modules && bun i
- postinstall: conditional electron-rebuild and run scripts/patch-electron-dev.mjs
- Packaging/build configuration:
- appId: dev.21st.agents; productName: 1Code; npmRebuild: true
- Protocol: name 1Code, schemes ["twentyfirst-agents"]
- Directories: buildResources: build, output: release
- Files to include: out/**/*
- ExtraResources: drizzle migrations to migrations; resources/bin/${platform}-${arch} to bin; resources/bin/VERSION to bin/VERSION
- asar: true, asarUnpack for: better-sqlite3, node-pty, @anthropic-ai/claude-agent-sdk, @zed-industries/codex-acp and related
- Mac: dmg and zip targets (arm64/x64), icon build/icon.icns, hardenedRuntime, entitlements, microphone usage description
- dmg window: width 540, height 380; contents layout; iconSize 80
- Windows: targets nsis, portable; icon build/icon.ico
- Linux: targets AppImage, deb; icon build/icon.png; category Development
- NSIS: oneClick false, allowToChangeInstallationDirectory true, installer/uninstaller icons
- Publish: provider generic, URL https://cdn.21st.dev/releases/desktop
- PNPM overrides: source-map-support>source-map -> 0.7.4
- Notable dependencies (selected):
- @ai-sdk/react, @anthropic-ai/claude-agent-sdk, @radix-ui/*, monaco-editor, xterm, tailwindcss, zod, zustand
- Electron toolchain: electron, electron-builder, electron-vite
- UI/runtime: react, react-dom, lucide-react, tailwind, shiki, posthog
- ORM/db: drizzle-orm, drizzle-kit, drizzle
- Others: better-sqlite3, node-pty, jsonc-parser, etc.
- Important file paths:
- Main: out/main/index.js
- Build resources/icons: build/icon.icns, build/icon.ico
- Entitlements: build/entitlements.mac.plist
- Patch script: scripts/patch-electron-dev.mjs
- Update/upload scripts: ./scripts/upload-release-wrangler.sh
- Postinstall behavior: runs electron-rebuild unless VERCEL is set, then patches Electron dev.# Stage 1: builder - use Bun to install dependencies and build the app FROM node:lts-bookworm AS builder # Install necessary tools and Bun RUN apt-get update && \ apt-get install -y --no-install-recommends curl ca-certificates && \ rm -rf /var/lib/apt/lists/* RUN bash -c " set -e curl -fsSL https://bun.sh/install | bash export BUN_INSTALL=/root/.bun export PATH=\"$BUN_INSTALL/bin:$PATH\" bun --version " ENV BUN_INSTALL=/root/.bun ENV PATH="$BUN_INSTALL/bin:$PATH" WORKDIR /workspace # Copy lockfile and manifest to leverage Bun's cache, then install dependencies COPY bun.lock bun.lockb package.json ./ RUN bun install # Copy the full source code and build COPY . . RUN bun run build RUN bun run dist # Stage 2: runtime - host the packaged AppImage FROM debian:bookworm-slim AS runtime # Install runtime dependencies common for AppImage execution RUN apt-get update && \ apt-get install -y --no-install-recommends \ ca-certificates \ curl \ libx11-6 libnss3 libxrandr2 libxdamage1 libxi6 libatk1.0-0 libatk-bridge2.0-0 \ libpangowin32-1 libgtk-3-0 \ && rm -rf /var/lib/apt/lists/* # Copy the packaged artifacts from the builder COPY --from=builder /workspace/release /app WORKDIR /app # Entry point to run the AppImage if present COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]
#!/usr/bin/env bash set -e APP_IMAGE=$(find /app -name '*.AppImage' 2>/dev/null | head -n1) if [ -z "$APP_IMAGE" ]; then echo "No AppImage found in /app" exit 1 fi chmod +x "$APP_IMAGE" 2>/dev/null || true exec "$APP_IMAGE" "$@"
#0 building with "default" instance using docker driver #1 [internal] load build definition from Dockerfile #1 transferring dockerfile: 1.40kB done #1 DONE 0.0s Dockerfile:10 -------------------- 8 | 9 | RUN bash -c " 10 | >>> set -e 11 | curl -fsSL https://bun.sh/install | bash 12 | export BUN_INSTALL=/root/.bun -------------------- ERROR: failed to build: failed to solve: dockerfile parse error on line 10: unknown instruction: set (did you mean user?)
# Stage 1: builder - use Bun to install dependencies and build the app FROM node:lts-bookworm AS builder # Install necessary tools RUN apt-get update && \ apt-get install -y --no-install-recommends curl ca-certificates python3 gcc g++ make libx11-dev libxkbfile-dev libsecret-1-dev libxss1 libnss3 libatk-bridge2.0-0 libatk1.0-0 libgtk-3-0 libasound2 ca-certificates WORKDIR /workspace # Copy lockfile and manifest to leverage Bun's cache, then install dependencies COPY bun.lock bun.lockb package.json ./ RUN /bin/bash -lc 'set -e; curl -fsSL https://bun.sh/install | bash; export BUN_INSTALL=/root/.bun; export PATH="$BUN_INSTALL/bin:$PATH"; bun --version; bun install' # Copy the full source code and build COPY . . RUN /bin/bash -lc 'set -e; export BUN_INSTALL=/root/.bun; export PATH="$BUN_INSTALL/bin:$PATH"; bun run build; bun run dist' # Stage 2: runtime - host the packaged AppImage FROM debian:bookworm-slim AS runtime # Install minimal runtime dependencies RUN apt-get update && \ apt-get install -y --no-install-recommends ca-certificates curl && \ rm -rf /var/lib/apt/lists/* # Copy the packaged artifacts from the builder COPY --from=builder /workspace/release /app WORKDIR /app # Entry point: indicate where the AppImage would be if packaging succeeded CMD ["bash", "-lc", "if [ -d /app ]; then echo 'Packaged app available under /app'; else echo 'No packaged app found'; fi"]
Failing step - Builder step: [builder 5/7] RUN /bin/bash -lc 'set -e; curl -fsSL https://bun.sh/install | bash; export BUN_INSTALL=/root/.bun; export PATH="$BUN_INSTALL/bin:$PATH"; bun --version; bun install' Exact error message and exit code - MODULE_NOT_FOUND, code: 'MODULE_NOT_FOUND' - Error: Cannot find module '/workspace/scripts/patch-electron-dev.mjs' - Node.js v24.14.0 - error: postinstall script from "21st-desktop" exited with 1 Missing packages or files mentioned - /workspace/scripts/patch-electron-dev.mjs (module not found during postinstall) Version/miscellaneous notes - bun install v1.3.11 (af24e281) executed as part of the step - warn: incorrect peer dependency "zod@3.25.76" shown during bun install - Node.js version reported: v24.14.0 - The overall Docker build failed with exit code 1 for this step
# Stage 1: builder - install dependencies and build the Electron app using npm
FROM node:lts-bookworm AS builder
# Install necessary build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential python3 gcc g++ make \
libx11-dev libxkbfile-dev libsecret-1-dev libxss1 libnss3 \
libatk-bridge2.0-0 libatk1.0-0 libgtk-3-0 libasound2 \
ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
# Copy manifest first to leverage layer caching (bun.lock can be used if bun install is desired)
COPY package.json bun.lock bun.lockb ./
# Copy the rest of the source to satisfy postinstall scripts and dependencies
COPY . .
# Install dependencies (use npm to produce a lockfile and respect package.json)
RUN npm ci --silent || npm install --silent
# Build the project and package artifacts
RUN npm run build
RUN npm run dist
# Stage 2: runtime image
FROM debian:bookworm-slim AS runtime
# Install minimal runtime dependencies for AppImage execution
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl libx11-6 libxext6 libxcb1 libxrandr2 libxrender1 \
libasound2 libatk1.0-0 libatk-bridge2.0-0 libfreetype6 libfontconfig1 \
&& rm -rf /var/lib/apt/lists/*
# Copy packaged app from builder
COPY --from=builder /workspace/release /app
WORKDIR /app
# Entrypoint to launch the packaged AppImage if present
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
#!/usr/bin/env bash set -e APP_IMAGE=$(find /app -name '*.AppImage' 2>/dev/null | head -n1) if [ -z "$APP_IMAGE" ]; then echo "No AppImage found in /app" exit 1 fi chmod +x "$APP_IMAGE" 2>/dev/null || true exec "$APP_IMAGE" "$@"
Error summary: - Exact error message and exit code: - "ERROR: process \"/bin/sh -c npm ci --silent || npm install --silent\" did not complete successfully: exit code: 1" - Failing command/step: - [builder 6/8] RUN npm ci --silent || npm install --silent (Dockerfile:22) - Missing packages or files mentioned: - npm ci is failing likely because there is no package-lock.json in the context. The repo provides bun.lock and bun.lockb (Bun lockfiles) instead of a package-lock.json, which npm ci requires. This mismatch (bun.lock/bun.lockb present vs npm expecting package-lock.json) is the likely cause. - Version mismatch information: - Base image: node:lts-bookworm (Node/LTS on Debian bookworm). Runtime stage uses debian:bookworm-slim. - The project appears to use Bun lockfiles (bun.lock, bun.lockb) but the build step invokes npm ci/npm install, indicating a mismatch between the package manager lockfiles and the package manager used during the step. Notes: - If the project intends to use Bun, change the failing step to bun install (or ensure a package-lock.json is present for npm ci). - If npm is intended, generate and commit a package-lock.json (npm install will create/update it) or adjust Dockerfile to use npm install without ci.
# Stage 1: builder - install dependencies and build the Electron app using npm
FROM node:lts-bookworm AS builder
# Install necessary build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential python3 gcc g++ make \
libx11-dev libxkbfile-dev libsecret-1-dev libxss1 libnss3 \
libatk-bridge2.0-0 libatk1.0-0 libgtk-3-0 libasound2 \
ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
# Copy manifests and lockfiles (bun.lock/bun.lockb may be present but we will use npm to install)
COPY package.json bun.lock bun.lockb ./
# Install dependencies using npm (generates package-lock.json if missing)
RUN npm install
# Copy the full source code
COPY . .
# Build the project and package artifacts
RUN npm run build
RUN npm run dist
# Stage 2: runtime image
FROM debian:bookworm-slim AS runtime
# Install minimal runtime dependencies for AppImage execution
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl libx11-6 libxext6 libxcb1 libxrandr2 libxrender1 \
libasound2 libatk1.0-0 libatk-bridge2.0-0 libgtk-3-0 \
&& rm -rf /var/lib/apt/lists/*
# Copy packaged app from builder
COPY --from=builder /workspace/release /app
WORKDIR /app
# Entrypoint script to run the AppImage if present
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
Summary (under 1500 chars): Failing step and exit: - Failing command/step: [builder 5/8] RUN npm install - Docker build exit: failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code: 1 Exact error message and related output to preserve: - npm error code ERESOLVE - npm error ERESOLVE unable to resolve dependency tree - While resolving: 21st-desktop@0.0.72 - Found: zod@3.25.76 - node_modules/zod - zod@"^3.24.1" from the root project - Could not resolve dependency: - peer zod@"^4.0.0" from @anthropic-ai/claude-agent-sdk@0.2.45 - node_modules/@anthropic-ai/claude-agent-sdk - @anthropic-ai/claude-agent-sdk@"0.2.45" from the root project - Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps - this command with --force or --legacy-peer-deps - For a full report see: /root/.npm/_logs/2026-03-18T23_58_40_934Z-eresolve-report.txt - npm notice New minor version of npm available! 11.9.0 -> 11.12.0 - A complete log of this run can be found in: /root/.npm/_logs/2026-03-18T23_58_40_934Z-debug-0.log Version mismatch or dependency issue: - Root project depends on zod@^3.24.1 (installed as zod@3.25.76) - @anthropic-ai/claude-agent-sdk@0.2.45 requires zod@^4.0.0 - This causes an ERESOLVE dependency-tree conflict that prevents npm install from completing Notes: - The error logs reference: /root/.npm/_logs/2026-03-18T23_58_40_934Z-eresolve-report.txt and /root/.npm/_logs/2026-03-18T23_58_40_934Z-debug-0.log - The build context shows apt-related steps completed, but the npm install step failed, causing the overall Docker build to fail at Dockerfile line 19.
# Stage 1: builder - install dependencies and build the Electron app using npm
FROM node:lts-bookworm AS builder
# Install necessary build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential python3 gcc g++ make \
libx11-dev libxkbfile-dev libsecret-1-dev libxss1 libnss3 \
libatk-bridge2.0-0 libatk1.0-0 libgtk-3-0 libasound2 \
ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
# Copy manifests; we rely on npm install to generate package-lock.json if needed
COPY package.json ./
# Install dependencies (allow legacy peer deps to avoid conflicts)
RUN npm install --legacy-peer-deps
# Copy the rest of the source code
COPY . .
# Build the project and package artifacts
RUN npm run build
RUN npm run dist
# Stage 2: runtime image
FROM debian:bookworm-slim AS runtime
# Install minimal runtime dependencies for AppImage execution
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl libx11-6 libxext6 libxcb1 libxrandr2 libxrender1 \
libasound2 libatk1.0-0 libatk-bridge2.0-0 libgtk-3-0 \
&& rm -rf /var/lib/apt/lists/*
# Copy packaged app from builder
COPY --from=builder /workspace/release /app
WORKDIR /app
# Entrypoint script to run the AppImage if present
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
- VerifyBuild status: build_failed
- Concerns
- Entrypoint script entrypoint.sh is referenced but not shown in the Dockerfile; ensure it exists in the repo and is executable.
- The runtime copies /workspace/release to /app; verify the build actually outputs to that path (dist script) for consistency across environments.
- If the packaged app is an AppImage, the runtime should include FUSE/libfuse; that dependency is not installed in the final runtime image.
- Build error
- Failing step: [builder 5/8] RUN npm install --legacy-peer-deps
- Exact error (preserve):
Error: Cannot find module '/workspace/scripts/patch-electron-dev.mjs'
#12 91.29 at Module._resolveFilename (node:internal/modules/cjs/loader:1456:15)
#12 91.29 at defaultResolveImpl (node:internal/modules/cjs/loader:1066:19)
#12 91.29 at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1071:22)
#12 91.29 at Module.load (node:internal/modules/cjs/loader:1242:25)
#12 91.29 at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
#12 91.29 at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
#12 91.29 at node:internal/main/run_main_module:33:47 {
#12 91.29 code: 'MODULE_NOT_FOUND',
#12 91.29 requireStack: []
#12 91.29 }
#12 91.29 Node.js v24.14.0
#12 91.30 npm error code 1
#12 91.30 npm error path /workspace
#12 91.30 npm error command failed
#12 91.30 npm error command sh -c ...
- Missing files/packages mentioned:
- /workspace/scripts/patch-electron-dev.mjs (module not found)
- Version mismatch / environment notes:
- Node.js version: v24.14.0
- npm version reported: 11.9.0 (notice of a newer minor version available: 11.12.0)
- Context:
- The error occurs during the npm install step, after an electron-related rebuild command is invoked in the postinstall script.
- The build context indicates the missing patch-electron-dev.mjs file is expected at /workspace/scripts but is not present in the image/build context.# Stage 1: builder - install dependencies and build the Electron app using npm
FROM node:lts-bookworm AS builder
# Install necessary build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential python3 gcc g++ make \
libx11-dev libxkbfile-dev libsecret-1-dev libxss1 libnss3 \
libatk-bridge2.0-0 libatk1.0-0 libgtk-3-0 libasound2 \
ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
# Copy only package.json first to install dependencies
COPY package.json ./
# Install dependencies (ignore scripts to avoid postinstall steps in this environment)
RUN npm install --ignore-scripts --legacy-peer-deps
# Copy the rest of the source code
COPY . .
# Build the project and package artifacts
RUN npm run build
RUN npm run dist
# Stage 2: runtime image
FROM debian:bookworm-slim AS runtime
# Install minimal runtime dependencies for AppImage execution
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl libx11-6 libxext6 libxcb1 libxrandr2 libxrender1 \
libasound2 libatk1.0-0 libatk-bridge2.0-0 libgtk-3-0 \
&& rm -rf /var/lib/apt/lists/*
# Copy packaged app from builder
COPY --from=builder /workspace/release /app
WORKDIR /app
# Entrypoint to run the AppImage if present (inline script, no external files)
ENTRYPOINT ["bash", "-lc", "APP_IMAGE=$(find /app -name '*.AppImage' 2>/dev/null | head -n1); if [ -z \"$APP_IMAGE\" ]; then echo 'No AppImage found in /app'; exit 1; fi; chmod +x \"$APP_IMAGE\" 2>/dev/null || true; exec \"$APP_IMAGE\" \"$@\""]
Concerns: Build artifacts naming/locations assume npm dist places an AppImage in /workspace/release; if AppImage isn't produced, container will fail at runtime., Running the AppImage may require a graphical environment; smoke tests should avoid launching GUI apps in CI. Smoke [PASS]: find /app -name '*.AppImage' -type f -print -quit Smoke [PASS]: APP_IMAGE=$(find /app -name '*.AppImage' 2>/dev/null | head -n1); if [ -z "$APP_IMAGE" ]; then echo 'No AppImage found'; exit 1; fi; if [ -x "$APP_IMAGE" ]; then echo 'AppImage executable'; else echo 'AppImage not executable'; exit 1; fi