CentOS 7 使用国内源加速 Docker pull 镜像

使用docker默认镜像常常出现速度慢甚至中断等状况,如何处理呢?能够使用镜像。软件源和扩展源详细安装步骤请看教程html

国内经常使用安装源有中国科技大学、阿里云、docker-cn、dockercloud、网易和华为。linux

使用清华大学镜像逐步安装docker-ce安装操做过程以下docker

#清华大学CentOS 镜像帮助
https://mirrors.tuna.tsinghua.edu.cn/help/centos/
#清华大学epel 镜像帮助
https://mirrors.tuna.tsinghua.edu.cn/help/epel/
#安装依赖软件
[root@promote ~]#yum install -y yum-utils device-mapper-persistent-data lvm2
#配置加速镜像repo文件
[root@promote ~]# yum-config-manager \
> --add-repo \
> https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo
已加载插件:fastestmirror
adding repo from: https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo
grabbing file https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
#清除yum缓存
[root@promote ~]# yum clean all
#从新建立yum缓存
[root@promote ~]# yum makecache
#安装docker-ce
[root@promote ~]# yum install docker-ce docker-ce-cli containerd.io
#
[root@promote ~]# sudo systemctl daemon-reload
[root@promote ~]# sudo systemctl restart docker

配置docker其余镜像源。(阿里云为例)json

#本页面有阿里云centos 和epel 镜像 能够Ctrl+F5搜索点击help连接
https://opsx.alibaba.com/mirror

阿里云配置帐号命令以下:vim

加速器地址

#xxxxxxxx 是我的加速器地址
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://xxxxxxxx.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

本文推荐配置2个安装源,分别是中国科技大学和阿里云,其余四个根据我的需求先择配置。注意:阿里云、华为云和网易云须要登陆帐号获取我的加速地址。具体命令以下centos

#部分docker安装后未生成daemon.json,请执行如下命令
[root@promote ~]# mkdir -p /etc/docker
[root@promote ~]# touch /etc/docker/daemon.json 
#配置文件
[root@promote ~]# vim /etc/docker/daemon.json
#如下三种配置文件任选一个 
#配置文件1 (中国科技大学)
[root@promote ~]# cat /etc/docker/daemon.json 
{
  "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}

#配置文件2 (docker-cn)
{
  "registry-mirrors": ["https://registry.docker-cn.com"]
}

#访问如下地址获取和安装脚本文件,适用于Linux、Mac和Windows
https://www.daocloud.io/mirror

中国科技大学Docker安装源帮助缓存

Docker中国镜像加速app

daocloud 镜像加速阿里云

登陆阿里云使用镜像加速获取自定义连接和帮助spa

注册或登陆华为云搜索镜像容器服务-镜像资源-镜像中心-镜像加速器获取自定义加速地址。相似阿里云和网易云

网易docker帮助连接点击。须要登陆或注册,不推荐

补充内容:pip 和 anaconda3 安装源配置

相关文章
相关标签/搜索