Interview Prep/Docker/Multi-stage builds, cache, tags and registries

How do you share a common base layer across 30 microservices?

IntermediateScenarioMulti-stage builds, cache, tags and registries
Answer

Situation read → Repeating the same hardening steps in every Dockerfile wastes build time and drifts.

What I'd do → Build an internal golden base (registry/base/python:3.12-2026w45) with CA bundles, non-root user, tzdata and agent config. Rebuild weekly, scan, sign and publish. Services FROM it by digest; Renovate bumps the digest.

Why → One place to patch, shared layers on nodes, consistent security posture.

Interview tip → Keep the base thin; a fat shared base becomes a dependency trap.

All Docker questions Roadmap: Docker & containers

More on Multi-stage builds, cache, tags and registries