English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Sometimes it may be difficult to pull images from DockerHub in China, at this time you can configure a mirror accelerator. Both Docker and many domestic cloud service providers provide domestic acceleration services, such as:
University of Science and Technology Mirror:https://docker.mirrors.ustc.edu.cn/
NetEase:https://hub-mirror.c.163.com/
Aliyun:https://<your ID>.mirror.aliyuncs.com
Qiniu Cloud Accelerator:https://reg-mirror.qiniu.com
After configuring an accelerator address, if you find that you cannot pull the image, please switch to another accelerator address. Major domestic cloud service providers all provide Docker image acceleration services, and it is recommended to choose the corresponding mirror acceleration service according to the cloud platform where Docker is running.
Aliyun mirror address:https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors, log in, select the mirror accelerator from the left menu to see your dedicated address:
There was also the official Docker accelerator before https://registry.docker-cn.com It seems that it can no longer be used now. We can add several domestic mirrors, and if some cannot be used, it will switch to a mirror that can be used to pull.
For systems using upstart, edit /etc/default/Configure the accelerator address in the DOCKER_OPTS of the docker file:
DOCKER_OPTS="--registry-mirror=https://registry.docker-cn.com"
Restart the service:
$ sudo service docker restart
For systems using systemd, please do the following: /etc/docker/daemon.json and write the following content (if the file does not exist, please create it):
{"registry-mirrors:["https://reg-mirror.qiniu.com/"]}
After that, restart the service:
$ sudo systemctl daemon-reload $ sudo systemctl restart docker
For those using Windows 10 The system, right-click on the Docker icon in the system tray at the bottom right of the system, select Settings from the right-click menu, open the configuration window, and select Daemon from the left navigation menu. Fill in the accelerator address in the Registrymirrors section. https://docker.mirrors.ustc.edu.cn/ , then click Apply to save and Docker will restart and apply the configured image address.
For users using Mac OS X, click the Docker for mac application icon in the taskbar-> Preferences...-> Daemon-> Registry mirrors. Fill in the accelerator address in the list https://reg-mirror.qiniu.com . After the modification is complete, click the Apply&Restart button, Docker will restart and apply the configured image address.
Check if the Accelerator is Effective After configuring the accelerator, if the pulling of images is still very slow, please manually check whether the accelerator configuration is effective. Run docker info in the command line, if you see the following content in the result, it means the configuration is successful.
$ docker info Registry Mirrors: https://reg-mirror.qiniu.com