A Docker build step takes 15 minutes because layers are rebuilt every time.
BeginnerScenarioBuilds, Artifacts, Nexus, SonarQube and Testing
Answer
Situation read → Poor layer ordering or no cache on ephemeral runners.
What I'd do →
- Order the Dockerfile so rarely changing steps come first: copy lockfile, install dependencies, then copy source.
- Use multi-stage builds and
.dockerignore. - Export/import cache:
--cache-to type=registry,ref=...and--cache-from.
Why → Ephemeral agents have no local cache, so a remote cache restores the benefit.
Interview tip → Layer order is the cheapest optimisation.
More on Builds, Artifacts, Nexus, SonarQube and Testing
A Maven project resolves dependencies from Maven Central on every build and a left-pad style outage would stop all builds.BeginnerYou must publish snapshot and release artifacts without overwriting a released version.IntermediateEvery merge to main should produce a unique semantic version automatically.IntermediateAn npm build is non-reproducible: different versions install on different days.BeginnerThe SonarQube quality gate must block merging PRs that add new bugs, vulnerabilities or uncovered code.IntermediateCoverage shows 0% in SonarQube although tests run in CI.Intermediate