1. Update yum
YumUpdate
2. Uninstall the built-in docker-related environment in the system.
YumRemove docker-common docker-SELinux docker-engine
3. Install the required software package. Yum-util provides the Yum-config-manager function,The other two are dependent on the devicemapper driver.
Yum Install-YYum-Utils device-mapper-persistent-data lvm2
4. Set the yum Source
Yum-Config-manager -- add-repo https://Download.docker.com/linux/centos/docker-ce.repo
5. You can view all docker versions in all repositories and select a specific version for installation.
YumList docker-ce -- showduplicates |Sort-R
6. Install docker
Yum InstallDocker-ce # because only the stable repository is enabled in the repo by default, the latest stable version 17 is installed here.12.0
7. Start and add to start
Systemctl start dockersystemctl enable docker
8. verify whether the installation is successful (either client or service indicates that the installation and startup of docker are successful)
Docker version
Blog on changing from wind to rain: https://www.cnblogs.com/yufeng218/p/8370670.html.
Install docker on centos7