centos 安装docker
官方参考地址:https://docs.docker.com/install/linux/docker-ce/centos/
里面包含包下载地址: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
首先,安装依赖
1、yum install -y yum-utils device-mapper-persistent-data lvm2
2、yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
3、yum install docker-ce docker-ce-cli containerd.io
报错:Problem: package docker-ce-3:19.03.11-3.el7.x86_64 requires containerd.io >= 1.2.2-3
解决上述问题方法(使用dnf安装新版的 containerd.io):
dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
#然后,再装剩下两个docker-ce docker-ce-cli
yum install docker-ce docker-ce-cli
#到这里docker安装成功,启动docker
systemctl start docker
#查看docker版本
docker --version
#设置开机自启
systemctl enable docker
#docker重新启动命令
systemctl restart docker
#查看docker启动状态
systemctl status docker
到这里docker已经成功安装并启动Ok~~~~!~~ 终于可以尽情的撸docker啦·~~~~