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
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum -y install docker-ce
systemctl start docker
配置镜像加速
mkdir -p /etc/docker
登录阿里云把自己的镜像加速器地址粘贴进去
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://1x9l75cp.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker
卸载
systemctl stop docker
yum -y remove docker-ce
rm -rf /var/lib/docker