Yum Installation
Check the centos version cat /etc/redhat-release
1, install GCC related
yum -y install gcc
yum -y install gcc-c++


2. Uninstall the previous version
sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine


3. Install the software package
sudo yum install -y yum-utils \ device-mapper-persistent-data lvm2


4. Set up the mirror vault
① Foreign Docker warehouse address (not recommended)
sudo yum-config-manager \ –add-repo \ https://download.docker.com/linux/centos/docker-ce.repo


Ali Docker warehouse address (recommended)
sudo yum-config-manager –add-repo \ http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo


5. Install the latest versions of Docker CE and Containerd
sudo yum install docker-ce docker-ce-cli containerd.io


6. Start Docker
sudo systemctl start docker


7. Check whether the installation is successful
① Docker version View the current version


② Run the Hello-world image to verify that Docker CE is correctly installed
sudo docker run hello-world


8. Uninstall docker CE
1. Close the Docker service
systemctl stop docker
Uninstall Docker package:
sudo yum remove docker-ce
③ Images, containers, volumes or custom profiles on the host will not be deleted automatically. To delete all images, containers and volumes:
sudo rm -rf /var/lib/docker




Centos7.0 + configures ali mirror accelerator
Ali Mirror address: cr.console.aliyun.com/cn-hangzhou…


1. Go to the configuration file (it may not exist)
vim /etc/docker/daemon.json
2. Configure Ali Accelerator (personal accelerator)
{“registry-mirrors”: [” your accelerator address “]}
3. Reload the configuration file
systemctl daemon-reload
4. Restart docker
systemctl restart docker


Docker service command
Start systemctl start docker
Daemon restart sudo systemctl daemon-reload
Restart the docker systemctl restart docker
Stop docker systemctl stop docker