docker pull很慢如何解决

docker pull很慢的问题

经常拉取镜像的时候很慢或者拉不下来,这里可以使用阿里云镜像加速器,然后试试看有没有效果

##使用阿里云镜像加速器
[root@localhost ~]# mkdir -p /etc/docker
[root@localhost ~]# tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://9cpn8tt6.mirror.aliyuncs.com"]
}
EOF
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker

docker pull时候太慢卡死

有时候我们在pull镜像的时候总是很慢, 这个时候网上的答案是把镜像的地址改成registry.docker-cn.com以提高镜像拉取速度

{ “registry-mirrors”: [“http://registry.docker-cn.com”] }

镜像加速

鉴于国内网络问题,后续拉取 Docker 镜像十分缓慢,我们可以需要配置加速器来解决,我使用的是网易的镜像地址:http://hub-mirror.c.163.com。

新版的 Docker 使用 /etc/docker/daemon.json(Linux) 或者 %programdata%\docker\config\daemon.json(Windows) 来配置 Daemon。

请在该配置文件中加入(没有该文件的话,请先建一个):

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

总结

作者:普通网友原文地址:https://blog.csdn.net/m0_54849873/article/details/124505850

%s 个评论

要回复文章请先登录注册