Docker 配置国内镜像拉取中心,Configure docker to use faster registries in China.

2023-05-12,,

Networking in China is really bad when it comes to using some cloud based tools like docker, it's usually a long time or just timeout you get trying to pull an image or even login to docker hub, luckily, so we need to change our docker registry mirror to domestic one in China.

Most often we get docker installed with installer, so we just add one registry to docker config by GUI.

The other way is by modifying the daemon.json in docker configuration folder .docker under current user home directory, in Linux, /etc/docker/daemon.json, if daemon.json does not exist, create one

And the file looks like this:

The GUI has set these up for us.

After all the above has been done, restart docker and try logging in or pulling one image, the streaming has become very fast.

Registries used in China in this article to accelerate the network condition:

#For Daocloud go to https://www.daocloud.io/mirror#accelerator-doc, this one accelerates more it seems!
"http://f1361db2.m.daocloud.io"
#One for docker-cn, this one is easier to remember
"https://registry.docker-cn.com"

Not that even though we have set up these domestic registries in China, acceleration is only effective pulling some hot images or official images, as to some images pushed by some personal, there may still be a timeout.

Docker 配置国内镜像拉取中心,Configure docker to use faster registries in China.的相关教程结束。

《Docker 配置国内镜像拉取中心,Configure docker to use faster registries in China..doc》

下载本文的Word格式文档,以方便收藏与打印。