安装新版本 Docker 报错 container-selinux >= 2:2.74
  brfSQeGvZNot 2023年11月13日 28 0

系统平台

CentOS Linux 7

Linux 3.10.0-1160.90.1.el7.x86_64

安装新版本 Docker 报错 container-selinux >= 2:2.74_linux

执行安装

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

安装新版本 Docker 报错 container-selinux >= 2:2.74_Docker_02

报错信息提示:

--> Finished Dependency Resolution
Error: Package: 3:docker-ce-24.0.5-1.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
Error: Package: containerd.io-1.6.22-3.1.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
#


解决办法

替换 yum 源,重新更新。

安装新版本 Docker 报错 container-selinux >= 2:2.74_Docker_03

# 替换 阿里云的 yum 源
# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

# 然后重新安装如下的两个工具包
# yum -y install container-selinux
# yum -y install epel-release

安装新版本 Docker 报错 container-selinux >= 2:2.74_linux_04

如上的两个工具包安装完成后,重新再次执行安装,就可以顺利安装新版本的 Docker 。

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

安装新版本 Docker 报错 container-selinux >= 2:2.74_Docker_05

# docker info
Client: Docker Engine - Community
 Version:    24.0.5
 Context:    default

安装新版本 Docker 报错 container-selinux >= 2:2.74_linux_06

# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2023-08-23 23:33:15 PDT; 5min ago
     Docs: https://docs.docker.com
 Main PID: 1222 (dockerd)
    Tasks: 10
   Memory: 103.7M
   CGroup: /system.slice/docker.service
           └─1222 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Aug 23 23:33:12 k8snode2 systemd[1]: Starting Docker Application Container Engine...
Aug 23 23:33:14 k8snode2 dockerd[1222]: time="2023-08-23T23:33:14.032030913-07:00" level=info msg="Starting up"
Aug 23 23:33:14 k8snode2 dockerd[1222]: time="2023-08-23T23:33:14.138279864-07:00" level=info msg="[graphdr...lay2"
Aug 23 23:33:14 k8snode2 dockerd[1222]: time="2023-08-23T23:33:14.140967948-07:00" level=info msg="Loading ...art."
Aug 23 23:33:14 k8snode2 dockerd[1222]: time="2023-08-23T23:33:14.536652849-07:00" level=info msg="Default ...ress"
Aug 23 23:33:14 k8snode2 dockerd[1222]: time="2023-08-23T23:33:14.686696619-07:00" level=info msg="Loading ...one."
Aug 23 23:33:15 k8snode2 dockerd[1222]: time="2023-08-23T23:33:15.018140290-07:00" level=info msg="Docker d...4.0.5
Aug 23 23:33:15 k8snode2 dockerd[1222]: time="2023-08-23T23:33:15.018582517-07:00" level=info msg="Daemon h...tion"
Aug 23 23:33:15 k8snode2 dockerd[1222]: time="2023-08-23T23:33:15.170126867-07:00" level=info msg="API list...sock"
Aug 23 23:33:15 k8snode2 systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
#

到此,报错问题已解决,Docker 服务可以正常使用了。

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月13日 0

暂无评论

推荐阅读
  wwLZeziuqjLR   2023年12月11日   31   0   0 Dockercentos
  MCWYWqSAMsot   2023年12月11日   33   0   0 Docker
  DnoStTHsc0vp   2023年12月11日   25   0   0 Docker
  nIt0XG0acU8j   2023年12月11日   32   0   0 linuxhtop
brfSQeGvZNot