Skip to content

build: install corepack in the docker build stage - #3616

Merged
Pooya Raki (PooyaRaki) merged 2 commits into
mainfrom
fix/docker-corepack-node26
Oct 15, 2026
Merged

Pooya Raki (PooyaRaki) merged 2 commits into
mainfrom
fix/docker-corepack-node26

Conversation

@PooyaRaki

@PooyaRaki Pooya Raki (PooyaRaki) commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Docker image build has been failing on main since the Node 26 upgrade (#3588): RUN yarn install exits with /bin/sh: yarn: not found (exit code 127) — failed run. The official node images stopped bundling Yarn v1 from Node 26 (nodejs/docker-node#2474), and Node itself stopped shipping Corepack from v25, so the build stage has no way to start Yarn. CI didn't catch it because the GitHub runners have Yarn installed globally; only the Docker build runs inside the bare image.

This installs Corepack in the build stage and enables it. Corepack resolves [email protected] from packageManager, which then defers to the vendored release via yarnPath. The Corepack version is pinned as a devDependency (0.36.0, past the 7-day npmMinimalAgeGate) and the Dockerfile reads it from package.json, so the existing npm Dependabot ecosystem bumps it — Dependabot's docker ecosystem only updates FROM tags, not version values in ARG/ENV. The production stage runs node directly and is unchanged.

Changes

  • Dockerfile: after copying package.json, npm install --global corepack@<devDependencies.corepack> && corepack enable in the base stage, before any yarn call.
  • package.json / yarn.lock: add [email protected] to devDependencies.

🤖 Generated with Claude Code

The node:26 images no longer bundle Yarn and Node 25+ no longer ships Corepack, so `yarn install` failed with exit code 127 in the devstaging build after the Node 26 upgrade (#3588). CI was unaffected because GitHub runners have Yarn installed globally.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Dockerfile reads the corepack version from devDependencies instead of hardcoding it, so the existing npm Dependabot ecosystem keeps it current.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@PooyaRaki
Pooya Raki (PooyaRaki) marked this pull request as ready for review October 15, 2026 16:35
@PooyaRaki
Pooya Raki (PooyaRaki) requested a review from a team as a code owner October 15, 2026 16:35

@vseehausen valleXYZ (vseehausen) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope it fixes.

@PooyaRaki
Pooya Raki (PooyaRaki) merged commit f73d381 into main Oct 15, 2026
12 checks passed
@PooyaRaki
Pooya Raki (PooyaRaki) deleted the fix/docker-corepack-node26 branch October 15, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants