首页 > 服务器    日期:2024-09-10 / 浏览

因为国内的网络访问问题,拉取镜像会响应超时,因此需要更换国内的镜像源。

网易:
http://hub-mirror.c.163.com

ustc:
https://docker.mirrors.ustc.edu.cn

中国科技大学:
https://docker.mirrors.ustc.edu.cn

阿里云:
https://cr.console.aliyun.com/

腾讯云:
https://mirror.ccs.tencentyun.com

创建或修改 /etc/docker/daemon.json 文件

vi /etc/docker/daemon.json

将文件的内容改为以下内容: 

{
    "registry-mirrors" : [
    "http://hub-mirror.c.163.com",
    "https://docker.mirrors.ustc.edu.cn",
    "https://cr.console.aliyun.com",
    "https://mirror.ccs.tencentyun.com"
  ]
}

重启docker

systemctl restart docker

查看docker镜像源

docker info

Docker更换镜像源详细代码教程

信息修改后则完成 

总结

觉得上面的内容有用吗?快来点个赞吧!

点赞() 我要打赏

温馨提示 : 本站内容来自会员投稿以及互联网,所有源码及教程均为作者总结编辑,请大家在使用过程中提前做好备份,以免发生无法预知的错误,源码类教程请勿直接用于生产环境!

 可能感兴趣的文章