11、centos8安装docker中的坑

centos8很坑的就是要更换yum源

 /etc/yum.repos.d

# 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.
#
#

[BaseOS]
name=CentOS-8 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=BaseOS&infra=$infra
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/8/BaseOS/x86_64/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

#additional packages that may be useful
[extras]
name=CentOS-8 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=extras&infra=$infra
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/8/extras/x86_64/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-8 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=centosplus&infra=$infra
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/8/centosplus/x86_64/os/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[AppStream]
name=CentOS-8 - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=$infra
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/8/AppStream/x86_64/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[PowerTools]
name=CentOS-8 - PowerTools
#mirrorlist=http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=PowerTools&infra=$infra
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/8/PowerTools/x86_64/os/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

都配置好了安装docker 会爆错,明明我的版本是CentOS 系统的内核版本高于 3.10,还报错

解决办法

yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

然后

yum install -y yum-utils device-mapper-persistent-data lvm2

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

yum install -y docker-ce

systemctl start docker

systemctl enable docker

在执行yum install -y docker-ce 中又出现了问题

解决办法 

sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

然后继续执行就行了

yum install -y docker-ce 
systemctl start docker
systemctl enable docker

  

原文地址:https://www.cnblogs.com/gfbzs/p/13845639.html