Ubuntu 16.04+、Debian 8+、CentOS 7
对于使用 systemd 的系统,请在 /etc/docker/daemon.json 中写入如下内容

(如果文件不存在请新建该文件:$ sudo touch /etc/docker/daemon.json)

(非 root 编辑:$ sudo vim /etc/docker/daemon.json)

{
  "registry-mirrors": [
"https://hub-mirror.c.163.com", "https://mirror.baidubce.com" ] }

(目前似乎没有什么公开的加速镜像了,Azure 中国限制内部使用,阿里云需要登录帐号获取加速地址,其它能搜到的镜像地址都不能访问了,就剩 163 和 百度似乎还没报错,但是也没有公开的官方页面承诺提供服务)

注意,一定要保证该文件符合 json 规范,否则 Docker 将不能启动。

之后重新启动服务。

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker

执行 $ sudo docker info,如果从结果中看到了如下内容,说明配置成功。

Registry Mirrors:

https://hub-mirror.c.163.com

https://mirror.baidubce.com

 

参考:

https://yeasy.gitbooks.io/docker_practice/install/mirror.html

https://ieevee.com/tech/2016/09/28/docker-mirror.html

https://docs.docker.com/registry/recipes/mirror/

相关文章:

  • 2021-08-31
  • 2021-07-16
猜你喜欢
  • 2021-08-09
  • 2022-12-23
  • 2021-05-27
  • 2022-01-10
  • 2022-12-23
  • 2021-07-27
  • 2021-11-06
相关资源
相似解决方案