Skip to content

docs: cache code-independent Docker tooling off the code-copy lineage#44

Merged
CybotTM merged 3 commits into
mainfrom
docs/cache-dev-tooling-stage
Jul 15, 2026
Merged

docs: cache code-independent Docker tooling off the code-copy lineage#44
CybotTM merged 3 commits into
mainfrom
docs/cache-dev-tooling-stage

Conversation

@CybotTM

@CybotTM CybotTM commented Jul 15, 2026

Copy link
Copy Markdown
Member

New reference multi-stage-caching.md. When dev/CI tooling (apt, xdebug, chromium, npm ci) is layered FROM the code stage, every source change re-runs it because COPY . . invalidates all downstream layers. Fix: re-parent the tooling into a sibling stage FROM base and pull the built tree via one COPY --from=deps. Includes lineage isolation (keep xdebug/chromium out of prod/profiling), same-RUN node_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.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread skills/docker-development/references/multi-stage-caching.md Outdated
@CybotTM
CybotTM force-pushed the docs/cache-dev-tooling-stage branch from 432d32c to 395ec0e Compare July 15, 2026 12:27
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>
@CybotTM
CybotTM force-pushed the docs/cache-dev-tooling-stage branch from 395ec0e to 3eebeb8 Compare July 15, 2026 12:27
CybotTM added 2 commits July 15, 2026 14:28
Inline # after FROM/COPY is not parsed as a comment by the Dockerfile parser.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@sonarqubecloud

Copy link
Copy Markdown

@CybotTM
CybotTM merged commit ccf6fe7 into main Jul 15, 2026
17 checks passed
@CybotTM
CybotTM deleted the docs/cache-dev-tooling-stage branch July 15, 2026 12: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.

1 participant