关于docker镜像拉取速度过慢的解决 - Go语言中文社区

关于docker镜像拉取速度过慢的解决


前提是我们在linux环境下安装好了docker,并且可以正常启动关闭。

但是当我们对镜像进行拉取的时候,会发现速度非常的慢,停在下面这个界面很久也不动。

[root@localhost ~]# docker pull mysql
Using default tag: latest
latest: Pulling from library/mysql
0a4690c5d889: Already exists 
98aa2fc6cbeb: Already exists 
0777e6eb0e6f: Already exists 
2464189c041c: Already exists 
b45df9dc827d: Already exists 
b42b00086160: Already exists 
bb93567627c7: Already exists 
b9125bcebe66: Already exists 
d263609b23c7: Downloading [=============================>                     ]  27.63MB/46.88MB
c9adffb2afb9: Download complete 
a555d31b3e6c: Download complete 
9524d219b6db: Download complete 

解决方法

我们可以进入阿里云的官网,登陆之后搜索docker,如下图

进入到上面的这个界面之后,拿到图中的加速器地址,在下面也会提示你怎么操作,你也可以跟着我的步骤来,将加速器地址换成你自己的加速器地址就行了

[root@localhost docker]# sudo mkdir -p /etc/docker
[root@localhost docker]# sudo tee /etc/docker/daemon.json <<-'EOF'
> {
>  "registry-mirrors":["https://f3lu6ju1.mirror.aliyuncs.com"]
> }
> EOF
{
 "registry-mirrors":["https://f3lu6ju1.mirror.aliyuncs.com"]
}
[root@localhost docker]# sudo systemctl daemon-reload
[root@localhost docker]# sudo systemctl restart docker

然后你拉取镜像的速度就会和我一样飞快啦!

 

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/Funny_Ma/article/details/96478395
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-03-07 21:01:56
  • 阅读 ( 1376 )
  • 分类:docker

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢