The following link is the official installation method ( Official is the best ) :
A . The official installation source
1. uninstall the old version
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
2. Set up the repository
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
3. Installation docker Community Edition
sudo yum install -y docker-ce
4. Start Close docker
systemctl start docker
two. Ali installation source
1. Confirm Ali cloud yum source file
vim /etc/yum.repos.d/Centos-7.repo
About configuring Ali cloud point I: Centos7 update source configured to Ali step
2. Use yum to start the installation docker
yum install -y docker
# Set to open from the start
systemctl enable docker
3. Check docker installed version
rpm -qi docker
three. Docker Mirror accelerator
Act One:
https://www.daocloud.io/mirror#accelerator-doc
# A command acceleration
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io
# This command is actually changed docker inside of a configuration file mirroring registered address , you can look at
cat /etc/docker/daemon.json
Note: Here will encounter a pit, above the accelerator command will modify our /etc/docker/daemon.json file , which is a dictionary that there are grammatical errors, leading docker can not be started ( reason is because one more comma )
Act II:
Directly
cat /etc/docker/daemon.json
Add Ali accelerator
{
"registry-mirrors": ["https://t7h7r7wr.mirror.aliyuncs.com"]
}