Official website: Install Docker Engine on CentOS | Docker Documentation
1. Make sure you are CentOS7 and above
cat /etc/redhat-release
2. Uninstall the old version
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
3. Yum installs gcc related
yum -y install gcc
yum -y install gcc-c++
4. Install the required software packages
yum-util provides yum-config-manager function, and the other two are devicemapper driver dependencies
yum install -y yum-utils device-mapper-persistent-data lvm2
5. Set the stable mirror warehouse (this cannot be set according to the requirements of the official website, and the domestic warehouse address must be set)