This is also the first time to install docker CE on red hat. I encountered some problems, so I recorded them.
1. Modify the redhat source to the YUM source of centos7
Query yum installation package
rpm -qa | grep yum
Uninstall the original yum installation package
rpm -e yum-3.4.3-150.el7.noarch --nodeps rpm -e yum-utils-1.1.31-40.el7.noarch --nodeps rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64 --nodeps
Download all the packages required by centos
wget http://vault.centos.org/centos/7.3.1611/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm wget http://vault.centos.org//centos/7.3.1611/os/x86_64/Packages/yum-updateonboot-1.1.31-40.el7.noarch.rpm wget http://vault.centos.org/centos/7.3.1611/os/x86_64/Packages/yum-utils-1.1.31-40.el7.noarch.rpm wget http://vault.centos.org/centos/7.3.1611/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm wget http://vault.centos.org/centos/7.3.1611/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm
Install downloaded package
rpm -ivh yum-*
Download centosBase.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo vim /etc/yum.repos.d/CentOS-Base.repo
Replace all $release with 7, and use the replacement in vim
:%s/$releasever/7/g
Clean up the YUM cache
Clean up the yum cache for the settings to take effect
yum clean all
Cache the package information on the server locally to improve the speed of searching and installing software
yum makecache
2. Install docker CE
Remove the original docker version
yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
Update yum corresponding package
yum install -y yum-utils \ device-mapper-persistent-data \ lvm2
Add docker to install repo
yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
Install docker. The specified version is 18.09.6
yum install docker-ce-18.09.6 docker-ce-cli-18.09.6 containerd.io
Start docker, because my redhat does not have systemctl installed, all are started with service
service docker start