Reorder image layers so dependency installs cache
A Dockerfile that reinstalls everything whenever any file changes, reordered so dependencies cache.
The ticket
Reorder container image layers so dependency installation caches between builds.
Acceptance criteria
- Dependency manifests are copied and installed before application source
- Cold and warm build timings are recorded
- The resulting image contents are unchanged
- The build works from a clean cache
What lands as proof
Cold and warm timings, where the warm build skips the install entirely.
Why teams defer it
- It builds correctly, so the only symptom is time that nobody attributes to layer ordering.
- Reordering can subtly change what ends up in the image, which needs checking rather than assuming.
Questions
- What does the agent actually change?
- The ticket is scoped to one outcome: reorder container image layers so dependency installation caches between builds. Work that serves that outcome is in scope, and anything outside it is left for a separate ticket, so the pull request stays reviewable.
- How do I know the work is done?
- The pull request carries the evidence, not only the diff. Here that means cold and warm build timings attached, so a reviewer can confirm the result without reproducing the work locally.
- How much oversight does this need?
- The run stops once the plan is written. Somebody reads the approach and approves it before any code exists, which is the cheapest moment to redirect the work.