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
原文地址:https://www.cnblogs.com/hixiaowei/p/8728289.html
时间: 2024-10-17 14:44:36