Docker 镜像加速

在国内通过docker pull 拉取镜像的时候,如果使用的默认配置,下载过程可能会很长,长到忘记要下载啥。

网上有很多修改的介绍,但都是介绍 阿里云 镜像啥的,除了需要注册外,我的个人感受就是配了阿里云跟使用默认配置一样慢。

这里经过测试推荐使用 中科大 的镜像源 地址,下载镜像时整体上的感受是比较顺畅的。

我这里用的 CentOS ,直接修改 /etc/docker/daemon.json 文件。

sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}
EOF

sudo systemctl daemon-reload
sudo systemctl restart docker
docker info

下面是简单的测试

[root@node108 opt]# !281
docker pull jertel/elastalert2:2.8.0
2.8.0: Pulling from jertel/elastalert2
f6e04ba65310: Downloading [========================>                          ]   13.1MB/27.14MB
b87859229fd4: Download complete 
de47f81eafde: Download complete 
efaf2ea83b66: Download complete 
dc50668abde8: Download complete 
6b15cc3a34e7: Download complete 
07466dbdcda4: Downloading  15.12MB
4f4fb700ef54: Download complete 

以上就是所有内容,欢迎和我互动讨论。

posted @ 2022-10-23 11:17  人间词话  阅读(264)  评论(1)    收藏  举报