0
0
Dockerdevops~10 mins

Registry mirroring concept in Docker - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Registry mirroring concept
Client requests image
Check local registry cache
Forward request to mirror registry
Mirror registry fetches image
Serve image to client
Client pulls image
The client asks for an image. If the local cache has it, serve it. If not, forward the request to the mirror registry, which fetches and serves the image.
Execution Sample
Docker
docker pull myregistry.local/myimage:latest
# Local registry checks cache
# If missing, forwards to mirror
# Mirror fetches from upstream
# Image served back to client
This simulates pulling an image using a registry mirror that caches images locally.
Process Table
StepActionLocal Registry CacheMirror Registry ActionClient Output
1Client requests image 'myimage:latest'Cache emptyIdleRequest sent
2Local registry checks cacheImage not foundIdleWaiting
3Local registry forwards request to mirrorCache emptyReceives requestWaiting
4Mirror registry checks own cacheCache emptyImage not foundWaiting
5Mirror fetches image from upstream registryCache emptyDownloading imageWaiting
6Mirror stores image in cacheCache emptyImage cachedWaiting
7Mirror serves image to local registryCache emptyServing imageWaiting
8Local registry caches imageImage cachedIdleReceiving image
9Local registry serves image to clientImage cachedIdleImage received
10Client completes pullImage cachedIdleImage ready locally
💡 Image successfully pulled and cached locally via mirror registry
Status Tracker
VariableStartAfter Step 3After Step 6After Step 8Final
Local Registry Cacheemptyemptyemptycached imagecached image
Mirror Registry Cacheemptyidlecached imagecached imagecached image
Client Staterequest sentwaitingwaitingreceiving imageimage ready
Key Moments - 3 Insights
Why does the local registry forward the request to the mirror?
Because the local registry cache is empty (see execution_table step 2), it cannot serve the image and must ask the mirror to fetch it.
When does the mirror registry cache the image?
After fetching the image from the upstream registry (step 6), the mirror stores it locally to serve future requests faster.
How does the client finally get the image?
The client receives the image after the local registry caches it and serves it back (step 9), completing the pull (step 10).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, at which step does the mirror registry start downloading the image?
AStep 6
BStep 4
CStep 5
DStep 7
💡 Hint
Check the 'Mirror Registry Action' column for when it changes to 'Downloading image'
According to the variable tracker, when does the local registry cache change from empty to cached image?
AAfter Step 8
BAfter Step 6
CAfter Step 3
DFinal
💡 Hint
Look at 'Local Registry Cache' values across steps in variable_tracker
If the local registry already had the image cached, what would happen at Step 2?
AIt would forward the request to the mirror
BIt would serve the image directly to the client
CThe mirror would fetch the image from upstream
DThe client would wait indefinitely
💡 Hint
Refer to execution_table step 2 where cache is checked
Concept Snapshot
Registry mirroring caches images locally to speed up pulls.
Client requests image from local registry.
If missing, local forwards to mirror registry.
Mirror fetches from upstream and caches image.
Local registry caches image from mirror and serves client.
This reduces load and speeds up repeated pulls.
Full Transcript
Registry mirroring means a local registry stores copies of images from an upstream source. When a client asks for an image, the local registry first checks if it has it cached. If not, it asks the mirror registry to get it. The mirror fetches the image from the upstream registry, caches it, and sends it back to the local registry. Then the local registry caches it and serves the client. This process speeds up image pulls and reduces network load by reusing cached images locally.