一般来说是按照以下命令执行
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce
systemctl start docker
但我遇到了两个问题。
1.package docker-ce-3:19.03.8-3.el7.x86_64 requires containerd.io >= 1.2.2-3
这个问题大概意思就是需要containerd.io并且版本要大于1.2.2-3,解决方案下载
yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
在这里鸣谢MachinePlay,因为参考了他的博客 https://blog.csdn.net/qq_36643282/article/details/105190759
2.file /usr/share/man/man1/docker-attach.1.gz from install of docker-ce-cli-1:19.03.6-3.el7.x86_64 conflicts with file from package podman-manpages-1.4.2-5.module_el8.1.0+237+63e26edc.noarch
这个问题是因为系统中安装了podman,它与docker冲突,有点一山不容二虎的意思。解决方案删除podman
dnf remove podman
参考链接 https://docsxyz.com/wiki/centos/docker-podman-conflicts
最后再yum install -y docker-ce
在此之前我还执行了视频教程里面的步骤,特此记录!
1.关闭防火墙
systemctl stop firewalld
2.禁用防火墙
systemctl disable firewalld
2.关闭selinux(修改里面的SELINUX=disabled)
vi /etc/selinux/config
3.重启
reboot