目前 docker 官方针对 centos8 还未完全适配,导致安装过程中会出现部分问题,就可能遇到的问题及处理办法,罗列如下:

1、containerd.io 依赖问题

Error: 
 Problem: package docker-ce-3:19.03.13-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
  - cannot install the best candidate for the job
  ...
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

该问题在 CentOS8 发布早期 Docker 安装包未适配导致,目前官方已经解决了该问题。但是截至目前,阿里云的国内源镜像中的 docker-ce.repo(https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo) 未更新,使用阿里云的repo仍然会出现以上问题,可以通过安装官方repo后替换 download.docker.com 为 mirrors.aliyun.com/docker-ce 解决。

dnf config-manager --add-repo  https://download.docker.com/linux/centos/docker-ce.repo
sed -i "s|download.docker.com|mirrors.aliyun.com/docker-ce|g" /etc/yum.repos.d/docker-ce.repo

2、Bridge 网络不通

容器通过brige方式联网时现象为无法解析DNS及访问网络,导致该问题的原因是CentOS8的防火墙由原来的 iptables 切换成了 nftables ,docker依赖于iptables来进行防火墙规则设置,目前官方还未兼容nftables。

下面给出了三种临时解决办法,可以根据需要选择其中一种进行设置:

a、让firewalld使用iptables

修改/etc/firewalld/firewalld.conf , 将 FirewallBackend=nftables 修改为 FirewallBackend=iptables ,然后重启防火墙。

b、启用masquerade

firewall-cmd  --permanent --add-masquerade
firewall-cmd --reload

c、添加docker0网口为信任(不建议)

firewall-cmd --permanent --zone=trusted --change-interface=docker0 
firewall-cmd --reload


原文链接地址:https://blog.exsvc.cn/article/centos8-install-docker-ce.html
转载请注明:转载自 易科博客 ,谢谢!

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注