Title: Faster contributor setup with the dev container · Issue #67440 · nodejs/node · GitHub
Open Graph Title: Faster contributor setup with the dev container · Issue #67440 · nodejs/node
X Title: Faster contributor setup with the dev container · Issue #67440 · nodejs/node
Description: In 2026 I ran two Node.js Code and Learn events. They went really well, but the main issue at both was getting people set up efficiently. The existing nodejs/devcontainer work helped tremendously: we hit far fewer platform-specific issue...
Open Graph Description: In 2026 I ran two Node.js Code and Learn events. They went really well, but the main issue at both was getting people set up efficiently. The existing nodejs/devcontainer work helped tremendously: ...
X Description: In 2026 I ran two Node.js Code and Learn events. They went really well, but the main issue at both was getting people set up efficiently. The existing nodejs/devcontainer work helped tremendously: ...
Opengraph URL: https://github.com/nodejs/node/issues/67440
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Faster contributor setup with the dev container","articleBody":"In 2026 I ran two Node.js Code and Learn events. They went really well, but the main issue at both was getting people set up efficiently. The existing [nodejs/devcontainer](https://github.com/nodejs/devcontainer) work helped tremendously: we hit far fewer platform-specific issues. Anyone who has been to a past Code and Learn knows what a headache the various Windows setups were. Though the dev container process isn't perfect. It asks a lot of first-time contributors, and I believe most of that can be avoided. This issue outlines how the devcontainer setup works today, the problems it has, and a roadmap for how I think we can improve it.\n\nThis isn't just for first-time contributors either. I prefer to use the devcontainer myself since it has the latest nightly build ready to go for me whenever I want to contribute something. **The goal is to improve the contributor setup process overall through optimizing our official devcontainer system.**\n\n## How it works today\n\n1. Every night, `nodejs/devcontainer` builds an image. It contains a shallow clone of `main`, the Nix toolchain, and a full build in `out/`. The build alone takes ~2 h 20 min on a 4-core GitHub runner.\n2. Contributors clone their fork and open it in the dev container ([`.devcontainer/base/devcontainer.json`](https://github.com/nodejs/node/blob/main/.devcontainer/base/devcontainer.json)). Their checkout is mounted over the image's copy, and the image's `out/` becomes the build cache.\n3. Ninja rebuilds any output that is older than its inputs. A fresh clone stamps every file with the current time, so the whole tree looks changed.\n4. To prevent that, the container runs `git restore-mtime`, which sets each file's time to its last commit. Files that haven't changed since the image are then older than the cache, and ninja skips them. This is why the docs need a full clone (`restore-mtime` reads the whole `nodejs/node` repo history).\n5. direnv loads the toolchain from the checkout's `shell.nix`. If the checkout's nixpkgs pin differs from the image's, Nix downloads a new toolchain.\n\n## Problems\n\nDownloads:\n\n| What | Size |\n| --- | --- |\n| Full clone of `nodejs/node` | ~1.6 GB (~2.5 GB on disk) |\n| `nodejs/devcontainer:nightly` | ~3.8 GB (10.4 GB unpacked) |\n| Nix toolchain, whenever the checkout's nixpkgs pin differs from the image's (the pin moves weekly) | 1.7 GiB (5 GiB unpacked) |\n| Total | ~5.4 GB, up to ~7.2 GB, and ~16 GB of disk |\n\nFirst build:\n\n- **Best case**, checkout and image at the same commit: 341 s on 6 cores. That is only because the documented `./configure --ninja` doesn't match the flags the image was built with. The image's own checkout, with its own flags, has nothing to rebuild.\n- **Stale image:** this fall the nightly schedule was disabled for inactivity, and the image stayed a month old. A fresh checkout then needed ~3,400 of 4,867 build steps, V8 included, which is nearly a full build.\n\nSilent failures:\n\n- `git restore-mtime` fails on \"dubious ownership\" under Podman, Colima and rootless Docker, and in some shells reports `0 files updated`. Either way, the build quietly falls back to compiling everything.\n- `restore-mtime` uses author dates by default. A commit authored before the image was built but landed after it keeps the cached object, so the binary silently lacks that change.\n- While the image was stale, its prebuilt `node` couldn't load the newer `lib/` from the checkout, and `make lint-js` broke.\n\nThe full history of the repo shouldn't be needed to make most contributions. Neither should hours of compiling.\n\n## Goal\n\nMake the dev container the fastest way for anyone to start working on Node.js:\n\n- **Small download:** a shallow clone (~120 MB) plus the image, with no toolchain download. That's ~3.9 GB instead of up to ~7.2 GB.\n- **Fast first build:** about a minute. When I tested a rebuild where every file's time was wrong, but the toolchain and flags matched the image, the ccache already shipped in the image made it finish in 73 s on 6 cores.\n- **Not only for first-timers.** Existing contributors can pull the latest nightly cache and start a branch from fresh `main` without rebuilding V8 locally.\n- **Not tied to your machine.** The heavy build runs in the dev container on any container platform (Docker, Podman, Codespaces, a remote host), while your edits stay in a normal local checkout with your own editor and git.\n\n## Plan\n\n### Stage 1: build the dev container image from every successful `nodejs/node` daily build\n\n- [x] https://github.com/nodejs/devcontainer/pull/31: build a given Node.js commit, triggered by `nodejs/node`'s daily workflow, with a weekly fallback and a keepalive, so the schedule can't silently stop again.\n- [x] https://github.com/nodejs/node/pull/67153: after the daily build succeeds, send its commit to `nodejs/devcontainer` using a `repository_dispatch` event.\n- [x] Give nodejs-github-bot write access on `nodejs/devcontainer` so the dispatch works.\n\n### Stage 2: fast contributor setup\n\nPRs to come; I'll link them here as they open.\n\n- [ ] https://github.com/nodejs/devcontainer/pull/32: record the image's Node.js commit, and publish an immutable `nightly-\u003csha>` tag next to `nightly`.\n- [ ] `nodejs/devcontainer`: replace `git restore-mtime` with a manifest of the image's file contents (git blob IDs). A small script gives unchanged files an old timestamp and changed files the current one. It needs no history, so a shallow clone works, and it is correct whether the checkout is ahead of or behind the image.\n- [ ] `nodejs/devcontainer`: load the toolchain from the image's own `shell.nix`, not the checkout's, so a newer nixpkgs pin doesn't trigger a download and a full rebuild.\n- [ ] `nodejs/devcontainer`: keep the image's checkout-dependent `node` off `PATH`, so `make lint-js` works when the checkout is newer than the image.\n- [ ] `nodejs/node`: have `.devcontainer/base/devcontainer.json` run the new script, falling back to `git restore-mtime` on older images.\n- [ ] `nodejs/node`: update `doc/contributing/using-devcontainer.md`: a shallow clone is enough, and build with the image's flags (`./configure $CONFIG_FLAGS`).\n\n### Later\n\n- A \"no clone\" mode that works directly in the image's own checkout, so the download is the image alone.\n- Codespaces support (https://github.com/nodejs/devcontainer/issues/19).\n- A smaller image, starting with the benchmark tooling (R, Java) that a build doesn't need.\n- Additional image variants for specific work, built through the existing `IMAGE_VARIANT` build arg. For example, one with `shell.nix`'s `withQuic` option for experimental QUIC work.\n\n## How you can help\n\nThe first blocker is https://github.com/nodejs/devcontainer/pull/31, so reviews there help the most.\n\nA simple :+1: on this issue tells me you're supportive of this effort. Please also comment if you have any ideas or critiques.\n\nAny existing Node.js contributors interested in helping directly, please request to join the [nodejs/devcontainer](https://github.com/orgs/nodejs/teams/devcontainer) team so I can tag you on necessary PRs! \n\n\u003csub>AI-assisted (Claude Opus 5.5, [my setup](https://github.com/Ethan-Arrowood/agentic)). The words are my own, per the [Human Voice](https://ai-policy.dev/policies/human-voice/1.0.0) policy.\u003c/sub>","author":{"url":"https://github.com/Ethan-Arrowood","@type":"Person","name":"Ethan-Arrowood"},"datePublished":"2026-11-12T16:50:36Z","url":"https://github.com/nodejs/node/issues/67440"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a609301d-4814-bf0a-aa2c-27177a8078cf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 87E2:3CF71B:9D3C79:D0BA87:6B0638EC |
| html-safe-nonce | 3c3309efee23f4b1d9abefd6de632c7529f254017d8ea0f5513dc90400db5fb4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0UyOjNDRjcxQjo5RDNDNzk6RDBCQTg3OjZCMDYzOEVDIiwidmlzaXRvcl9pZCI6IjU1OTg1ODQ2MjM0MDUwODY5NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 484a9e8a62e714901d62fedace2373a2fd0ff55be8394cfecf483489ab3a3ff6 |
| hovercard-subject-tag | issue:6354690608 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/67440/issue_layout |
| twitter:image | https://opengraph.githubassets.com/faf77ea19c7fd7d1e032942e087f5acfde791d221fc427afb61c3cf8fed833f7/nodejs/node/issues/67440 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/faf77ea19c7fd7d1e032942e087f5acfde791d221fc427afb61c3cf8fed833f7/nodejs/node/issues/67440 |
| og:image:alt | In 2026 I ran two Node.js Code and Learn events. They went really well, but the main issue at both was getting people set up efficiently. The existing nodejs/devcontainer work helped tremendously: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Ethan-Arrowood |
| hostname | github.com |
| expected-hostname | github.com |
| None | dcf72c457c022486d23c3cbb0dd21aba537a87611ca9ddabd1799cf2eaa9b297 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0f38f5735226749ec5e08a8649dce4cb2613d9ad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width