yum update
# vim /etc/yum.repos.d/docker.repo
//添加以下内容
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
# yum install docker-engine -y
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-‘EOF‘ { "registry-mirrors": ["https://t4gshq2x.mirror.aliyuncs.com"] } EOF
sudo systemctl daemon-reload
sudo systemctl restart docker