Article Directory
One, docker installation steps
Tip: Before installation, you can use the command:
yum check-update
check whether yum is the latest version, if a series of things appear, it means it is not the latest, use the command:yum update
update.
1. Uninstall the old version
sudo yum remove docker docker-common docker-selinux docker-engine
2. Installation dependencies
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
3. Add mirror source
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4. View all docker versions in the warehouse
yum list docker-ce --showduplicates | sort -r
5. Install docker
Syntax:, sudo yum install 版本
here I installed 18.03.1.ce, there will be a prompt during the installation process Is this ok [y/N]:
, just keep typing y .
sudo yum install docker-ce-18.03.1.ce
6. Start docker
After entering the command, if nothing is displayed, it means the startup is successful!
sudo systemctl start docker
停止docker:sudo systemctl stop docker
7. Set up docker to start automatically after booting
sudo systemctl enable docker
8. Check if docker is installed successfully
docker version
If something similar to the figure below appears, it means the docker installation is successful!
9. Uninstall docker
1. List installed docker
yum list installed | grep docker
2. Delete docker
sudo yum -y remove version
3. Delete the mirror
rm -rf /var/lib/docker