Centos Docker配置全攻略

本文档详细记录了一位南京在校学生配置Centos Docker的过程,包括如何在校园网环境下设置yum源和Docker代理,以解决安装和使用Docker时的网络问题。通过更改yum源为163镜像源,安装Docker CE,并在Docker内部配置代理,最终成功运行Docker。
摘要由CSDN通过智能技术生成

坐标南京某学校。

校园网配置Docker需要配置一下代理服务器。

从下午两点配置到晚上19.38,记录一下,方便以后的同学少走弯路。

1 yum镜像源配置

如果第2步可以直接跑通则不需要这一步,可直接进入第2步。

这里将yum源改为 mirrors.163.com

(1)备份系统原始yum源

# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

(2)进入文件夹

# cd /etc/yum.repos.d/

(3)下载新的yum源配置文件到这个文件夹,对于centos7来讲,命令是

# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

(其他centos系统将7换为对应版本号)

(4)生成缓存 

# yum makecache

(5)更新系统

# yum -y update

更新完一堆东西后会显示

 zenity.x86_64 0:3.28.1-1.el7                                                                
  zlib.x86_64 0:1.2.7-18.el7                                                                  

Replaced:
  caribou.x86_64 0:0.4.21-1.el7                                                               
  caribou-gtk2-module.x86_64 0:0.4.21-1.el7                                                   
  caribou-gtk3-module.x86_64 0:0.4.21-1.el7                                                   
  gnome-dictionary-libs.x86_64 0:3.20.0-1.el7                                                 
  gnome-tweak-tool.noarch 0:3.22.0-1.el7                                                      
  grub2.x86_64 1:2.02-0.65.el7.centos.2                                                       
  grub2-tools.x86_64 1:2.02-0.65.el7.centos.2                                                 
  mesa-libwayland-egl.x86_64 0:17.2.3-8.20171019.el7                                          
  pyatspi.noarch 0:2.20.3-1.el7                                                               
  python2-caribou.noarch 0:0.4.21-1.el7                                                       

Complete!

2 配置好了yum镜像源后,可以安装Docker了

(1)yum安装

[root@localhost yum.repos.d]# yum install -y yum-utils device-mapper-persistent-data lvm2Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: ap.stykers.moe
 * extras: mirrors.nju.edu.cn
 * updates: ftp.sjtu.edu.cn
base                                                                   | 3.6 kB  00:00:00     
extras                                                                 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值