博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CentOS 7 使用国内源加速 Docker pull 镜像
阅读量:7099 次
发布时间:2019-06-28

本文共 1893 字,大约阅读时间需要 6 分钟。

hot3.png

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

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

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

#清华大学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已加载插件:fastestmirroradding repo from: https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repograbbing file https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.reporepo 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其他镜像源。(阿里云为例)

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

阿里云配置账号命令如下:

加速器地址

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

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

#部分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和Windowshttps://www.daocloud.io/mirror

补充内容:

 

转载于:https://my.oschina.net/u/1011130/blog/3031053

你可能感兴趣的文章
MySQL-----笔记3:存储引擎
查看>>
《构建之法》提问;软件和软工的来源;各种项目管理系统优缺点
查看>>
发送邮件的工具类
查看>>
在asp.net中,添加itemtempert 项模板时,如果在项模板里有其它控件,如何控件这些控件的属性?...
查看>>
微软企业库5.0 学习之路——第八步、使用Configuration Setting模块等多种方式分类管理企业库配置信息...
查看>>
网络学习笔记:TCP/IP连网和Internet
查看>>
栈实现迷宫问题
查看>>
POJ2724 Purifying Machine(二分图)
查看>>
[ISSUE]fail to forward message:TypeError: Cannot read property 'msgRemote' of undefined
查看>>
new 和 malloc 的区别 (转载)
查看>>
L2-004. 这是二叉搜索树吗?
查看>>
【操作系统】实验三 进程调度模拟程序
查看>>
LR分析法
查看>>
js冒泡排序
查看>>
创建Android本地repo
查看>>
<context-param>与<init-param>的区别与作用
查看>>
师傅赠言
查看>>
<script type="javascript"> 与<script language="javascript"> 有什么区别啊
查看>>
一些记不住的问题
查看>>
利用zabbix监控ogg进程(Linux平台下)
查看>>