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 →
- Prefer Docker Official Images, Verified Publisher or Docker Hardened Images.
- Mirror into our registry, scan and sign before use.
- Pin by digest.
- 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.
More on Multi-stage builds, cache, tags and registries
Show a multi-stage Dockerfile for a Java Spring Boot app and explain what you gain.BeginnerCI rebuilds from scratch every run and takes 12 minutes. How do you bring it down?IntermediateYou tag every build `myapp:latest`. A rollback is requested. What happens?BeginnerHow do you promote an image from dev to prod registry without rebuilding?IntermediateDisk on the build server keeps filling up with images.BeginnerWhen do you use `--no-cache` and when is it a smell?Beginner