Run a registry as a pull-through cache for Docker Hub and point your Docker daemons at it. Images your builds have pulled before are then served from your own storage, so a Hub outage or throttling does not stop builds that use those images.
What a pull-through cache does
When a build asks the mirror for an image it does not have, the mirror fetches it from Docker Hub and keeps a copy. Later requests come from the copy. Docker's documentation describes running the official Registry image as the cache, with a proxy section in its configuration.
The point for resilience is simple: a cache only helps with images it has already seen. Warm it before you need it.
Setup steps
- Run the registry image with a
proxyblock whoseremoteurlis Docker Hub's registry address. - Use the filesystem storage driver, which Docker recommends for performance and correctness.
- On every build host, add the mirror under
registry-mirrorsin the daemon's configuration file, then reload Docker. - Add authentication to the mirror. Docker warns that if you give the mirror Hub credentials, anything that user can reach becomes available through it.
- Enable
deletein the registry configuration so you can clean up the cache later. - Pull your base images once through the mirror to warm it.
Limits to know
- Only the central Docker Hub can be mirrored this way, not other private registries.
- Mirrors remain subject to Docker's fair use policy.
- If Hub access is blocked by an organization policy, pulls through the mirror also fail, with the documented workaround of pulling manually and retagging.
- Several caches sharing one backend do not guarantee that concurrent requests avoid duplicate pulls.
- A cache is not a vault. It is built for speed and availability, not as a managed record of what you shipped, so keep your own list of approved image versions.
Cache versus copying images into your own registry
| Approach | Strength | Weakness |
|---|---|---|
| Pull-through cache | Automatic, no workflow change | Only holds what was pulled, not a managed set |
| Copy chosen images to your registry | You control which versions exist | Needs a promotion step and upkeep |
Many teams use both: a cache for convenience, and a curated internal copy of the base images they approve.
Try it yourself
Click through it at your own pace, or open it full screen.
Look at how an image breaks down into layers and packages. Whatever your cache serves still needs scanning, because a copy of a vulnerable base image is still vulnerable.
Safeguard scans container images for vulnerabilities and can gate builds on the result. Try a free scan.
Quick check
Will a mirror save me if I never pulled the image before?
No. It can only serve what it has cached or can fetch. Warm it with the images you rely on.
Does a mirror make images safer?
No. It improves availability. Scan and pin the images you serve.
Sources
Last reviewed: 19 October 2026.