Skip to content

template(node): persist Corepack cache across container rebuilds#101

Merged
nozaq merged 1 commit into
mainfrom
claude/node-corepack-cache-pypmuw
Jul 26, 2026
Merged

template(node): persist Corepack cache across container rebuilds#101
nozaq merged 1 commit into
mainfrom
claude/node-corepack-cache-pypmuw

Conversation

@nozaq

@nozaq nozaq commented Jul 26, 2026

Copy link
Copy Markdown
Member

Summary

This change adds persistent volume mounting for Corepack's cache directory in the Node.js dev container template, eliminating the need to re-download package managers (yarn/pnpm) on container rebuilds.

Key Changes

  • devcontainer.json: Added a named volume mount for Corepack's cache at /home/dev/.cache/node/corepack to persist across rebuilds
  • Documentation: Updated both README.md and NOTES.md with a new "Persistent Caches" section explaining the Corepack cache persistence
  • Tips section: Clarified that npm/npx are not shipped in the image and updated guidance for keeping npm's download cache
  • Version bump: Updated template version from 1.0.4 to 1.1.0

Implementation Details

The Corepack cache is mounted as a named volume using the pattern ${devcontainerId}-node-corepack-cache, which ensures each dev container instance has its own isolated cache that persists across rebuilds. This improves the developer experience by avoiding redundant downloads of package manager releases when updating the container image.

https://claude.ai/code/session_018orh4x8NqS164wMPe5ZN7f

The node image now pre-creates /home/dev/.cache/node/corepack, Corepack's
default cache directory, owned by the dev user. Mount a named volume there
so downloaded yarn/pnpm releases survive container rebuilds, matching the
cache handling of the other templates.

Document the volume in a Persistent Caches section, and clarify that npm
and npx are not shipped in the image so the npm cache tip only applies when
npm is enabled through Corepack.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018orh4x8NqS164wMPe5ZN7f
@nozaq nozaq changed the title Persist Corepack cache across container rebuilds template(node): persist Corepack cache across container rebuilds Jul 26, 2026
@nozaq
nozaq merged commit 0178619 into main Jul 26, 2026
59 of 60 checks passed
@nozaq
nozaq deleted the claude/node-corepack-cache-pypmuw branch July 26, 2026 08:37
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