Interview Prep/Docker/Build Performance & CI

How do you decide between one big `RUN` and several small ones?

BeginnerProductionBuild Performance & CI
Answer

Group commands that must be atomic for size reasons (install + cleanup). Split steps with different change frequencies (system deps vs app deps). The layer count itself rarely matters; wasted bytes and cache invalidation do. With heredocs the multi-line form stays readable.

All Docker questions Roadmap: Docker & containers

More on Build Performance & CI