1. Configure ali's yum mirror source
1. Obtain Alibaba Cloud repo
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.bak
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
2. Clean up the original cache and re-cache
yum clean all
yum makecache
3.1 Uninstall the old version of docker
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
3.2 Download the required installation package
yum install -y yum-utils
3.3 Setting up the mirror warehouse
yum-config-manager \
--add-repo \
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3.4 Update the yum package index
yum makecache fast
3.5 Install docker related configuration
yum install docker-ce docker-ce-cli containerd.io
4. Start docker
systemctl start docker
docker version
systemctl enable docker
5.run hello-world
docker run hello-world