CentOS6.8安装docker教程

  1. 在VMware新安装CentOS6.8系统
    CentOS6.8可在阿里镜像库下载: https://mirrors.aliyun.com/centos-vault/6.8/isos/x86_64/
  2. 在新安装系统配置yum源
    2.1 进入目录 /etc/yum.repos.d
    2.2 对原配置备份
    mv *.repo ./bak
    2.3 下载新yum配置
    wget http://mirrors.aliyun.com/repo/Centos-6.repo
    2.4 重命名下载的配置为 CentOS-Base.repo
    2.5 yum clean all && yum makecache
    配置可参考:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-vault-6.8 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.8/os/$basearch/
        http://mirrors.aliyuncs.com/centos-vault/6.8/os/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos-vault/6.8/os/$basearch/
        https://vault.centos.org/6.8/os/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#released updates 
[updates]
name=CentOS-vault-6.8 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.8/updates/$basearch/
        http://mirrors.aliyuncs.com/centos-vault/6.8/updates/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos-vault/6.8/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#additional packages that may be useful
[extras]
name=CentOS-vault-6.8 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.8/extras/$basearch/
        http://mirrors.aliyuncs.com/centos-vault/6.8/extras/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos-vault/6.8/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-vault-6.10 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
        http://mirrors.aliyuncs.com/centos-vault/6.10/centosplus/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-vault-6.10 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/
        http://mirrors.aliyuncs.com/centos-vault/6.10/contrib/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
  1. 安装docker
    3.1 yum install -y epel-release
    3.2 yum install -y docker-io
    使用yum install -y docker-io安装docker会失败,多次尝试均失败,故改为以下方式安装,并且可以成功安装
    yum install -y https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm
    3.3 修改安装后的配置文件/etc/sysconfig/docker
    other_args="--registry-mirror=https://xxxxxx.mirror.aliyuncs.com"
    3.4 启动docker
    service docker start

参考:
CentOS 6的yum源配置(最新地址) https://www.cnblogs.com/liucx/p/14745726.html
CentOS6.8配置阿里yum源 https://www.cnblogs.com/ddstudy/p/12547103.html
CentOS6.8上Docker的安装 https://www.cnblogs.com/wxwgk/p/13856308.html
解决报错 YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
https://blog.csdn.net/justinzwd/article/details/113780067

posted @ 2023-02-25 21:52  海*风  阅读(346)  评论(0编辑  收藏  举报