1.卸载旧版docker
sudo yum remove docker \

              docker-client \
              docker-client-latest \
              docker-common \
              docker-latest \
              docker-latest-logrotate \
              docker-logrotate \
              docker-engine

2.设置docker yum源(二选一)
设置为阿里云的源速度可以快一点(推荐)
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

3.安装docker
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

4.启动docker
sudo systemctl start docker

5.设置开机自启动
sudo systemctl enable docker

6.查看版本
docker -v
docker info

标签: docker

添加新评论