参考官方文档:[https://docs.docker.com/engine/install/centos/](https://docs.docker.com/engine/install/centos/)
1、卸载老版本
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
2、使用存储库安装
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
3、安装 Docker 引擎
sudo yum install docker-ce docker-ce-cli containerd.io
4、启动 Docker
sudo systemctl start docker
5、通过运行hello-world 映像验证 Docker Engine 是否已正确安装
sudo docker run hello-world
|