一、文档路径:https://docs.docker.com/install/linux/docker-ce/centos/
二、移除旧版本docker:
sudo yum remove -y docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
三、开始安装:
1、安装依赖:
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
2、更改镜像源:
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
3、安装docker-ce(docker社区版):
sudo yum install -y docker-ce
4、启动docker:
sudo systemctl start docker
5、验证是否安装成功(非必须):
sudo docker run hello-world