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

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.

325785-20190115100917709-364824363.png

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

325785-20190115101056191-1790037624.png
And the file looks like this:
325785-20190115101209977-2041327421.png
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.

325785-20190115101408587-1687957493.png

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.:(
325785-20190115103820065-1195663425.png
Comparision below:(
325785-20190115103838745-710667366.png
Ps: In such cases, I would recommend to use http://baidu.com first to find posts using same keywords in English, or Chinese, ways are out there.

转载于:https://www.cnblogs.com/hualiu0/p/10270443.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值