Boost Docker Pull Speed with Chinese Mirror Accelerators: Step-by-Step Guide
This article explains how to configure Docker and Containerd to use domestic image‑mirror services, providing detailed commands and verification steps that dramatically reduce image‑pull latency and improve development and operations efficiency in cloud‑native environments.
In the cloud‑native era, container technologies like Docker and Containerd are standard for building, deploying, and running applications. Pulling images from public registries such as Docker Hub can be slow, especially under poor network conditions or remote locations.
Image Acceleration Services
Domestic mirror services can be configured to speed up pulls. Examples include:
https://dockerhub.icu
https://docker.hlyun.org
Configuration Steps
1. Add an insecure registry parameter to Docker's config file:
<code>"registry-mirrors": [
"https://dockerhub.icu"
],</code>2. Apply the configuration:
<code>$ sudo kill -1 $(ps -ef | grep [d]ockerd | awk '{print $2}')</code>3. Verify the effective configuration:
<code>$ sudo docker info | awk '/Mirrors/,/Live/ {print $0}' | grep http
https://dockerhub.icu/</code>Image Pull Verification
1. Capture packets while pulling an image:
<code>$ tcpdump -i ens33 -enn '(udp and port 53) or (host dockerhub.icu)' -w dockerhub.pcap</code>Tip: The command only captures DNS packets and those destined for dockerhub.icu.
2. Pull an image from hub.docker.com:
<code>$ docker pull docker.io/library/debian:stable-slim
stable-slim: Pulling from library/debian
Digest: sha256:...
Status: Image is up to date for debian:stable-slim</code>3. Inspect the captured packets. If the traffic is only with the public IP resolved from dockerhub.icu, the mirror configuration succeeded.
Conclusion
Following these steps can dramatically improve Docker image pull speed, saving time and enhancing development and operations efficiency. Selecting a stable, fast mirror is essential for a smooth container workflow.
Linux Ops Smart Journey
The operations journey never stops—pursuing excellence endlessly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.