Pull rate limits from Docker Hub are failing CI. What are your options?
IntermediateScenarioMulti-stage builds, cache, tags and registries
Answer
Situation read → Anonymous pulls are rate limited per IP; shared NAT in CI exhausts it.
What I'd do →
- Authenticate pulls with a Docker Hub service account (
docker login). - Set up a pull-through cache (Harbor proxy project, ECR pull-through cache,
registry:2withproxy.remoteurl). - Mirror critical base images into our own registry and reference those.
- Configure
registry-mirrorsindaemon.json.
Why → Reduces external dependency and speeds up pulls.
Interview tip → Mirroring base images also protects you from upstream tag removal.
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