Skip to content

fix(templates): keep Corepack's Yarn in the Node runtime image - #4

Merged
MarshallOfSound merged 1 commit into
mainfrom
fix-corepack-home
Oct 22, 2026
Merged

MarshallOfSound merged 1 commit into
mainfrom
fix-corepack-home

Conversation

@claude

@claude claude Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Requested by Samuel Attard · Slack thread

This sets COREPACK_HOME=/usr/local/share/corepack in the runtime stage of templates/Dockerfile.node. Without it, Corepack caches Yarn in root's $HOME at build time, but pods run as uid 1000 with HOME=/tmp, so any yarn ... CMD (such as the probot one the template suggests) downloads Yarn again on every pod start and fails when it can't reach repo.yarnpkg.com. The migrations of docs-reviewer and trop hit this and fixed it the same way in their own Dockerfiles.


Generated by Claude Code

Corepack cached Yarn under root's $HOME at build time, but the runtime image
runs with HOME=/tmp, so a `yarn ...` CMD re-downloaded Yarn on every pod start
and failed without network. Set COREPACK_HOME in the runtime stage so the
download made during `yarn workspaces focus` is baked into the image.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe
@claude
claude Bot marked this pull request as ready for review October 22, 2026 19:22
@claude
claude Bot requested a review from a team as a code owner October 22, 2026 19:22

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I reviewed this and didn't find any bugs. Every path in the repo falls under the CODEOWNERS wildcard, so a code owner still needs to look.

What was reviewed:

  • COREPACK_HOME is set before corepack enable and the production yarn workspaces focus, so Yarn is fetched into /usr/local/share/corepack at build time, under root's default 022 umask, and uid 1000 can read it.
  • With packageManager pinned in package.json, Corepack only needs to read that cache at runtime, so the read-only root filesystem shouldn't block a yarn ... CMD. Yarn's own runtime writes still go to HOME=/tmp.
  • The build stage doesn't set the variable and runs entirely as root, so it isn't affected.
Extended reasoning...

The change adds one ENV line and a three-line comment to the runtime stage of templates/Dockerfile.node, so Corepack caches Yarn somewhere uid 1000 can read. It touches no auth, crypto or data-handling code. It is small and correct as far as I can tell, but CODEOWNERS assigns every path (*) to an owning team, so I deferred instead of approving.

@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) October 22, 2026 19:28

@electron-faraday electron-faraday Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

faraday: this pull request passed the faraday/cage check via the 1h grant in .github/faraday.yml — a listed reviewer approved commit 8a7d09d3 and the Claude Code Review check passed on it. This review is faraday's own approval of that commit so a required-approvals rule is satisfied; it does not count toward faraday's own tally.

@MarshallOfSound
MarshallOfSound merged commit 7ed329e into main Oct 22, 2026
7 checks passed
@MarshallOfSound
MarshallOfSound deleted the fix-corepack-home branch October 22, 2026 19:29
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