CentOS 7 配置Docker镜像的国内源

docker 运维 · systemofdown · 于 4年前 发布 · 5501 次阅读

国内镜像

网易163镜像加速

--registry-mirror=http://hub-mirror.c.163.com

中科大镜像加速

--registry-mirror=https://docker.mirrors.ustc.edu.cn

阿里云镜像加速

--registry-mirror=https://{your_id}.mirror.aliyuncs.com

配置

编辑/etc/docker/daemon.json文件,并输入国内镜像源地址

sudo vi /etc/docker/daemon.json

网易163镜像加速

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

中科大镜像加速

{
    "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]     
}

也可以直接下载站点镜像:

docker pull hub.c.163.com/library/tomcat:latest  //复制站点链接用 pull 下来

阿里云

镜像加速需要注册账号 阿里云官网:https://www.aliyun.com/ 登录之后选择控制台,找到容器镜像服务,或者从此链接进入 https://cr.console.aliyun.com/#/accelerator 选择镜像加速器,就可以看到你的专属加速地址了。

{
  "registry-mirrors": ["https://og7vpkky.mirror.aliyuncs.com"]
}

修改完地址后,重新加载配置文件,重启docker服务

sudo systemctl daemon-reload
sudo systemctl restart docker
共收到 0 条回复
没有找到数据。
添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册