Docker RHEL 上的 CE - 要求:container-selinux >= 2.9

Docker CE on RHEL - Requires: container-selinux >= 2.9

我正在尝试使用此 RHEL 上安装 Docker CE。这是我的 RHEL 版本:

Red Hat Enterprise Linux Server release 7.3 (Maipo)

当我执行此操作时:

sudo yum -y install docker-ce

我收到这个错误:

Error: Package: docker-ce-17.06.0.ce-1.el7.centos.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2.9
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

我尝试使用 --skip-brokenrpm -Va --nofiles --nodigest 但再次遇到相同的错误。请让我知道如何解决此问题并在 RHEL 7.3 中安装 Docker CE。

container-selinux 包可从 rhel-7-server-extras-rpms 频道获得。您可以使用以下方式启用它:

subscription-manager repos --enable=rhel-7-server-extras-rpms

包的源也已导出到 git.centos.org,因此您可以使用 mock:

自行重建它

(这不是编程问题,因此您应该使用其他站点之一。)

Docker RHEL 不支持 CE。您试图绕过的任何方式都不受支持。您可以在 Docker Documentation 中查看支持的平台。我建议您要么使用受支持的 OS,要么切换到企业版。

只需安装selinux最新版本即可修复:
sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm

更多版本在 http://mirror.centos.org/centos/7/extras/x86_64/Packages/

2.9 的旧版本: http://ftp.riken.jp/Linux/cern/centos/7/extras/x86_64/Packages/

从 Centos 存储库安装 Selinux 对我有用:
1。转到 http://mirror.centos.org/centos/7/extras/x86_64/Packages/
2。查找 container-selinux 的最新版本 i.e. container-selinux-2.21-1.el7.noarch.rpm
3。 运行 在您的终端上执行以下命令:$ sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/**Add_current_container-selinux_package_here**
4。该命令应如下所示 $ sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.21-1.el7.noarch.rpm
注意:容器版本不断更新,因此您应该在 Centos 的存储库中寻找最新版本

我遇到了同样的错误要求:container-selinux >= 2.9 on amazon ec2 instance(Rhel7)

我试图通过执行来添加额外的包 rmp 回购 sudo yum-config-manager --enable rhui-REGION-rhel-server-extras
但它有效。 按照 https://installdocker.blogspot.com/ 中的步骤,我能够安装 docker。

我点击了很多链接,包括官方文档,但是都以这个错误告终:

Requires: container-selinux >= 2.9
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

它对我有用的唯一方法如下(我猜 yum upgrade 有效):

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

yum upgrade docker-ce

前往http://mirror.centos.org/centos/7/extras/x86_64/Packages/ and get the link to the latest container-selinux package. In my case the link was http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.68-1.el7.noarch.rpm

以 root 身份前往您的终端并 运行:

yum install http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.68-1.el7.noarch.rpm

之后你可以继续安装docker:

yum install docker-ce

尝试:

yum install http://vault.centos.org/centos/7.3.1611/extras/x86_64/Packages/container-selinux-2.9-4.el7.noarch.rpm

对我有用。

this link 帮我解决了这个问题

解决方法如下: 对于 centos: 尝试

sudo yum install --setopt=obsoletes=0 \
>    docker-ce-17.03.2.ce-1.el7.centos.x86_64 \
>    docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch

对于 Rhel:

sudo yum install --setopt=obsoletes=0 docker-ce-17.03.3.ce-1.el7.x86_64.rpm docker-ce-selinux-17.03.3.ce-1.el7.noarch.rpm

要更新 container-selinux,我必须先安装 epel-release

添加 Centos-7 存储库

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

安装epel-release

yum install epel-release

更新container-selinux

yum install container-selinux

错误:包:2:container-selinux-2.74-1.el7.noarch (rhel-7-server-extras-rpms)

要求:selinux-policy >= 3.13.1-216.el7

已安装:selinux-policy-3.13.1-192.el7_5.6.noarch (@rhel-7-server-rpms)

selinux-policy = 3.13.1-192.el7_5.6

container-selinux 版本存在依赖性问题

修复 rhel 上的这个错误 7.x 我已经执行了以下操作

1) 百胜安装 http://vault.centos.org/centos/7.3.1611/extras/x86_64/Packages/container-selinux-2.9-4.el7.noarch.rpm

2) yum install -y yum-utils device-mapper-persistent-data lvm2

3) yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

4) 百胜安装docker-ce

现在启动 docker 服务

为了解决我在 RHEL-7

上安装 docker-ce 时遇到的以下错误
Error: Package: 3:docker-ce-18.09.5-3.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2.9
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

请运行 在安装最新版本的 docker-ce

之前执行以下命令
yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.68-1.el7.noarch.rpm

一旦上一个命令 运行s 成功,然后使用以下命令安装 docker-ce

yum -y install docker-ce

安装完成后 运行

systemctl start docker

注意:运行 所有这些命令都使用 root 用户

2019 年 6 月更新

多么狗的晚餐。不幸的是,其他答案对我不起作用。

在大多数情况下,official docker instructions 使用存储库进行安装确实有效。

sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2

其次是:

sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

但是,我不得不修改下一个命令如下(添加--nobest):

sudo yum install docker-ce --nobest

最后,检查docker客户端:

docker --version
Docker version 18.09.7, build 2d0083d

另请注意,以上内容适用于 AWS 上的标准 RHEL AMI,但不适用于 Amazon Linux AMI 类型。可能还会发现引用 this github issue 很有见地。

额外奖励,我发现以下附加命令很有用:

启动docker守护进程:

sudo systemctl start docker.service

授予当前用户(在我的例子中 ec2-user - 检查 whoami)对 docker 组的权限。这避免了 运行 使用 sudo 的一切。

sudo usermod -aG docker $USER

现在,注销并以与以前相同的用户身份再次登录(在我的情况下 ec2-user)。

此时,一切都应该正常了。检查 docker 守护进程:

docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

在 CentOS7 上,我必须遵循第三种安装方法,get-docker.sh https://docs.docker.com/install/linux/docker-ce/centos/#install-using-the-convenience-script

您已经安装了 3.7 版的 container-selinux 检查以下 docker-ce 版本是否适合您,它适合我。

sudo yum -y install docker-ce-cli.x86_64 1:19.03.5-3.el7

解决此问题的最佳方法是。 从 http://mirror.centos.org/centos/7/extras/x86_64/Packages/ 下载最新的 container-selinux 包到需要安装 docker 的虚拟机或机器中。 错误:有时它会要求从 repo 下载 red hat 订阅。 我们可以在没有订阅的情况下手动完成,如下所示 运行 下面的命令将手动安装依赖项 rpm -i container-selinux-2.107-3.el7.noarch.rpm 然后 运行 yum install docker-ce

谢谢 萨阿

与其他答案一样,将 "extras" 订阅频道添加到 CentOS 7 Spacewalk 部署也解决了这个问题。

[已解决] 一个简单的命令即可解决此问题。

yum install http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm

DOCKER RHEL 未正式支持 Ce 以修复 运行 以下命令

wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm
sudo rpm -i container-selinux-2.107.el7.noarch.rpm

wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/slirp4netns-0.4.3-4.el7_8.x86_64.rpm



#Set up the Docker CE repository on RHEL:
sudo yum install -y yum-utils
sudo yum install -y device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
yum install docker-ce docker-ce-cli containerd.io

#Start Docker:
sudo systemctl start docker
 
#Test your Docker CE installation:
sudo docker run hello-world

如果我们在 aws ec2 实例中安装 docker 时遇到问题。 按照以下步骤操作:

sudo yum update -y
sudo amazon-linux-extras install docker
sudo yum install docker
sudo service docker start
sudo systemctl enable docker
systemctl status docker

(link : https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html)