卸载旧版本
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
添加仓库
yum install -y yum-utils
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
安装
yum install docker-ce docker-ce-cli containerd.io
启动
systemctl start docker
查看版本
docker version
验证
docker run hello-world
更多关于安装的资料:https://docs.docker.com/engine/install/centos/