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

What are the risks of using a public image straight from Docker Hub in production?

IntermediateScenarioMulti-stage builds, cache, tags and registries
Answer

Situation read → Supply-chain exposure.

What I'd do →

  1. Prefer Docker Official Images, Verified Publisher or Docker Hardened Images.
  2. Mirror into our registry, scan and sign before use.
  3. Pin by digest.
  4. Review the Dockerfile, check maintenance cadence and CVE counts.

Why → Tags can be repointed, images can be abandoned, and typo-squatted images carry malware.

Interview tip → Treat third-party images as third-party code.

All Docker questions Roadmap: Docker & containers

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