1、 Docker requires the kernel version of the CentOS system to be higher than 3.10. Check the prerequisites on this page to verify whether your CentOS version supports Docker.
View your current kernel version through the uname -r command
$ uname -r
2、 Log in to Centos with root privileges. Ensure that the yum package is updated to the latest.
$ sudo yum update
3、 Uninstall the old version (if the old version is installed)
$ sudo yum remove docker docker-common docker-selinux docker-engine
4、 Install the required software packages, yum-util provides yum-config-manager function, and the other two are dependent on the devicemapper driver
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
5、 Set yum source
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
6、 You can view all docker versions in all warehouses and select a specific version to install
$ yum list docker-ce --showduplicates | sort -r
7、 Install docker
$ sudo yum install docker-ce #Since only the stable warehouse is opened by default in the repo, the latest stable version 18 is installed here.06.3
$ sudo yum install <FQPN> #For example: sudo yum install docker-ce-18.06.3.ce
8、 Start and add startup
$ sudo systemctl start docker
$ sudo systemctl enable docker
9、 Verify that the installation is successful (there are two parts, client and service, indicating that the docker installation and startup are successful)
$ docker version
Recommended Posts