Fix admin Docker build on Node 26: corepack no longer ships with Node - #320
Merged
Conversation
Node 26 removed corepack from the distribution (verified: node:26-bookworm-slim has npm 11.19.0 but no corepack binary), so the builder stage's 'RUN corepack enable && corepack prepare pnpm@11.18.0 --activate' failed with '/bin/sh: 1: corepack: not found' (exit 127) — the exact failure in the 'build and push admin' release job on the #319 merge commit. actions/setup-node's Node 26 still ships corepack, which is why CI's own pnpm jobs pass while the Docker build breaks — and CI never builds the admin image (only the release workflow does), so the green PR checks on #319 could not have caught this. Found only by the release job running on the merged main, the 'workflow first executes after merge' failure class. Fix: install corepack explicitly and pinned (corepack@0.35.0) before using it to honour the packageManager pin (pnpm@11.18.0), exactly as before. Verified: 'docker build -f frontends/apps/admin/Dockerfile .' completes end to end (corepack install, corepack prepare pnpm@11.18.0, pnpm install --frozen-lockfile, turbo build --filter=admin..., runtime stage) — the identical step that failed in CI.
|
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.
Summary
One-line fix to
frontends/apps/admin/Dockerfile: install corepack explicitly (pinnedcorepack@0.35.0) before the existingcorepack enable && corepack prepare pnpm@11.18.0 --activate, because Node 26 removed corepack from its distribution.Intent
Fixes the red release workflow on
main— thebuild and push adminjob (run 31931499510) failed on the #319 merge commit with:Root cause: #319 moved the admin base image
node:22-bookworm-slim→node:26-bookworm-slim. Node 26 removed corepack from the distribution — verified empirically:node:26-bookworm-slim(v26.7.0) hasnpmbut nocorepackbinary.Why CI did not catch it
actions/setup-node's Node 26 still ships corepack (the CIEnable corepacksteps pass on node-version'26'), and CI never builds the admin Docker image — only the release workflow does (it runs on push-to-main/tag). So #319's green PR checks were structurally unable to see this failure: the first execution of the changed code was the release job after merge — the exact "workflow first executes after merge" failure class AGENTS.md documents forrelease.yml.Scope
frontends/apps/admin/Dockerfilebuilder stage — oneRUNline, plus an updated comment explaining the gap.publish-node-sdkjob usesactions/setup-node, which still has corepack).Verification
The exact failing step, run for real:
Completes end to end:
npm install -g corepack@0.35.0→corepack enable→corepack prepare pnpm@11.18.0 --activate→pnpm install --frozen-lockfile→turbo run build --filter=admin...(Next build, 21.8s) → runtime stage assembled and exported. This is the identical step that failed in CI.The release job itself will not re-run on this PR (it triggers on main push/tag) — the fix lands on
mainand the next release-workflow run is the durable proof.Risk Assessment
AI Usage Declaration
node:26-bookworm-slimand inspecting; the build itself run to completion.)Reviewer Focus
npm install -g pnpm@11.18.0(simpler, one fewer tool) — I kept corepack for consistency with the CI workflows' own corepack-based flow.