template(node): persist Corepack cache across container rebuilds#101
Merged
Conversation
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
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
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
/home/dev/.cache/node/corepackto persist across rebuildsImplementation 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