卸载docker:
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
安装仓库:
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
安装docker引擎:
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
启动docker:
sudo systemctl start docker
验证:
sudo docker run hello-world
出现如下信息表示成功啦:
设置为开机自启:
systemctl enable docker
恭喜你啦。