1. Use the following command to view the docker version
[root@xxx ~]# docker version
The result as shown in the figure below shows that docker is not installed
2. Install docker
My steps are as follows:
- Installation dependencies
yum install -y yum-utils device-mapper-persistent-data lvm2
The installation ends as shown below:
- Configure mirror warehouse
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
After the end, the following picture:
- You can check the configuration with the following command (this step can be omitted)
more /etc/yum.repos.d/docker-ce.repo
- Install docker
yum install docker-ce
After entering the command, the following installation information will be listed and asked if you want to install it. Just type y and hit enter:
After the installation is complete, the following figure:
- Enter the following command to set docker to automatically start at boot
systemctl start docker
systemctl enable docker
- Check the docker version information, complete!
Digression:
1. There are two versions of docker, docker-ce is a community version, free of charge; docker-cc is an enterprise version, which requires payment;
2. More is a linux command, you can view file information in pages, the space key to page down, and the b key to page up;
3. systemctl is a linux command, the function of the subcommand start is to start the service, and the function of enable is to automatically start the next time you boot