1、删除老的版本
sudo yum remove docker\ docker-client\ docker-client-latest\ docker-common\2、安装依赖包
sudo yum install -y yum-utils \ device-mapper-persistent-data \ 1vm23、安装docker
sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo sudo yum install docker-ce docker-ce-cli containerd.io4、启动docker
sudo systemctl start docker查看
docker -v5、开机自启动
sudo systemctl enable docker6、docker镜像加速,找到阿里云的镜像加速器,你自己的
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://*****.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker