centOS7 安装docker报错

315 阅读1分钟

Linux系统版本:CentosOS 7.8

安装docker报以下问题

yum install -y install -y docker-ce docker-ce-cli containerd.io

image.png

Error: Package: containerd.io-1.4.13-3.1.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
Error: Package: 3:docker-ce-20.10.12-3.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
Error: Package: docker-ce-rootless-extras-20.10.12-3.el7.x86_64 (docker-ce-stable)
           Requires: slirp4netns >= 0.4
Error: Package: docker-ce-rootless-extras-20.10.12-3.el7.x86_64 (docker-ce-stable)
           Requires: fuse-overlayfs >= 0.7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

解决办法 如果没有配置docker的yum源,可以先配置下。

sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

在文件末尾添加一下内容

cat << EOF >>/etc/yum.repos.d/docker-ce.repo 
[centos-extras]
name=centos extras -$basearch
baseurl=http://mirror.centos.org/centos/7/extras/x86_64
enable=1
gpgcheck=0
EOF

然后安装

yum install -y docker-ce docker-ce-cli containerd.io

通过以上配置,我的问题就解决了,希望可以帮到你。