docs: cache code-independent Docker tooling off the code-copy lineage#44
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Code Review
This pull request adds a new reference document, 'multi-stage-caching.md', which explains how to optimize Docker multi-stage builds by keeping code-independent tooling cached separately from the code-copy lineage. It also updates 'SKILL.md' to link to this new reference. The review feedback correctly identifies that inline comments in the provided Dockerfile example are syntactically invalid and should be moved to their own lines.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
432d32c to
395ec0e
Compare
New reference multi-stage-caching.md: dev/CI images that layer apt/xdebug/ chromium/npm-ci FROM the code stage re-run all of it on every source change (COPY . . invalidates everything downstream). Fix by re-parenting the tooling into a sibling stage FROM base and pulling the built tree via one COPY --from=deps. Covers lineage isolation (xdebug/chromium out of prod/ profiling), same-layer node_modules cleanup, and verifying the cache with a content change (not touch). Not indexed in SKILL.md's References list because that file is at its 500-word cap; suggest indexing when word budget allows. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
395ec0e to
3eebeb8
Compare
Inline # after FROM/COPY is not parsed as a comment by the Dockerfile parser. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
|



New reference
multi-stage-caching.md. When dev/CI tooling (apt, xdebug, chromium,npm ci) is layeredFROMthe code stage, every source change re-runs it becauseCOPY . .invalidates all downstream layers. Fix: re-parent the tooling into a sibling stageFROM baseand pull the built tree via oneCOPY --from=deps. Includes lineage isolation (keep xdebug/chromium out of prod/profiling), same-RUNnode_modules cleanup, and verifying the cache via a content change (BuildKit hashes content, not mtime).Note: not added to SKILL.md's References index because that file is at its 500-word cap (adding a line failed Skill Validation). Suggest indexing it there when word budget allows.