参考:https://docs.docker.com/install/linux/docker-ce/centos/
1. 删除系统自动的docker和依赖,系统自带的版本太老:
yum remove docker* container-selinux
2. 添加软件源
yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3. 添加必要的依赖
yum install -y device-mapper-persistent-data lvm2
4. 更新安装docker
yum makecache fast
yum install docker-ce docker-ce-cli containerd.io
5. 启动docker
systemctl start docker
6. 查看是否安装和启动成功:
ps aux|grep docker
docker info
docker version
end.