Repository navigation
chore(docker): pin Node and prep images for a read-only root filesystem - #9387
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryPins the app image’s Node version and prepares writable scratch and cache paths for a read-only root filesystem.
Acknowledged choices from waleedlatif1:
Reviews (1) · Last reviewed commit: "chore(docker): pin Node and prep images ..." · Reviewed by Greptile |
This branch was successfully deployed
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
base):ARG NODE_VERSION=24.22.1, installnodejs=${NODE_VERSION}-1nodesource1, then assertnode --version=v${NODE_VERSION}. Before this,apt-get install nodejstook whatever NodeSource had published when the layer last rebuilt. The layer is cached, so Node only changed when an unrelated edit forced a rebuild. The version string comes from the NodeSourcenode_24.xPackages index for both amd64 and arm64. The-1nodesource1suffix selectsnodejsitself rather thannsolid, which Providesnodejsat the same version numbers (24.22.1-ns…).build-base/depsinheritbase, so isolated-vm's node-gyp build compiles against the same Node (ABI 137) that runs it. 24.22.1 is the Node already running, so the next image build ships the same Node.VOLUMEdeclarations, following the egress gateway's precedent (mkdir+chown, thenVOLUME). ECS copies the image's contents and ownership into a bind volume mounted at aVOLUMEpath./tmp(1777) isos.tmpdir()scratch for ffmpeg/audio processing, KB imports, the Pi agent, and libvips (sharp) spill files./app/apps/sim/.next/cache(nextjs:nodejs) holds the image optimizer's disk cache (.next/cache/images) and thefetchdata cache (next: { revalidate })./tmp(1777) +VOLUME.PYTHONDONTWRITEBYTECODE=1, so no__pycache__is written next toserver.py; pip already byte-compiles site-packages. Also/tmp(1777) +VOLUME, declared below the model download that stages wheels in/tmp.experimental.isrFlushToDiskdeliberately not changed. In the pinned Next 16.4.1,isrFlushToDisk: falsedoes more than stop ISR write-back to.next/server/app. It also turns off the image optimizer's disk cache (image-optimizer.js: the disk LRU is only built whenisrFlushToDiskis true, and there is no in-memory fallback), so every/_next/imagemiss would re-encode. That would change behavior today, so it waits for the read-only flip. Build-time prerender reads don't depend on it: the export worker hard-codesflushToDisk: !hasNextSupport, and seed/APP_PAGE reads aren't gated on it. OnlyFETCHreads and all writes are.Self-hosting impact
VOLUMEcreates anonymous volumes for/tmpand.next/cache(and/tmpin realtime). Compose reuses them when it recreates a container, so the image/fetch cache and/tmpnow survivedocker compose upupgrades instead of resetting. Fetch entries still honor theirrevalidatewindows (60s–1h).docker compose up -Vrenews them, anddocker compose down -vremoves them. Nothing in the compose files mounts these paths, so nothing conflicts.VOLUME. No change.Type of Change
Testing
node_24.xPackages index (amd64 + arm64) fornodejs 24.22.1-1nodesource1. The package has no Recommends, so--no-install-recommendsinstalls the same files.isrFlushToDiskthrough the publishednext@16.4.1tarball (image-optimizer.js,next-server.js,file-system-cache.js,export/worker.js,build/index.js).node --versionassertion fails the build if the pin drifts.Checklist
test-auditauthoring gate)