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

I am trying to install Docker CE on RHEL using this link. This is my RHEL version:

Red Hat Enterprise Linux Server release 7.3 (Maipo)

When I execute this:

sudo yum -y install docker-ce

I am getting this error:

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

I tried using --skip-broken and rpm -Va --nofiles --nodigest but again getting the same error. Please let me know how to resolve this issue and install Docker CE in RHEL 7.3.


Solution 1:

The container-selinux package is available from the rhel-7-server-extras-rpms channel. You can enable it using:

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

Sources for the package have been exported to git.centos.org, too, so you could rebuild it yourself using mock:

  • https://git.centos.org/summary/rpms!container-selinux.git

(This is not a programming question, so you should use one of the other sites.)

Solution 2:

Installing the Selinux from the Centos repository worked for me:
1. Go to http://mirror.centos.org/centos/7/extras/x86_64/Packages/
2. Find the latest version for container-selinux i.e. container-selinux-2.21-1.el7.noarch.rpm
3. Run the following command on your terminal: $ sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/**Add_current_container-selinux_package_here**
4. The command should looks like the following $ sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.21-1.el7.noarch.rpm
Note: the container version is constantly being updated, that is why you should look for the latest version in the Centos' repository

Solution 3:

Just install selinux latest version to fix it:
sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm

More versions at http://mirror.centos.org/centos/7/extras/x86_64/Packages/

Older versions of 2.9: http://ftp.riken.jp/Linux/cern/centos/7/extras/x86_64/Packages/