Interview Prep/Docker/CI/CD and production rollouts

Make image builds faster for a monorepo with 20 services.

AdvancedScenarioCI/CD and production rollouts
Answer

Situation read → Shared context makes everything rebuild.

What I'd do → Use docker buildx bake with a docker-bake.hcl defining targets and shared base, per-service .dockerignore (via Dockerfile.dockerignore), COPY only the service path plus shared libs, remote cache and --set *.cache-to. Detect changed services in CI with git diff.

Why → Bake builds targets in parallel with shared cache.

Interview tip → Context size matters: use named contexts to limit it.

All Docker questions Roadmap: Docker & containers

More on CI/CD and production rollouts