install Docker CE 17.03 on RHEL7
For those who are facing below 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
While installing docker on RHEL 7.3+ we need to execute:
sudo subscription-manager repos --enable rhel-7-server-extras-rpms
which will enable extra rpms to be installed on yum update.After this execute:
sudo yum update
Then follow: Install Docker
This has worked for me.
As per the documentation here, you can install Docker CE 17.03 (or future versions) on RHEL 7.3 64-bit via:
Set up the Docker CE repository on RHEL:
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
Install the latest version of Docker CE on RHEL:
sudo yum -y install docker-ce
Alternatively, you can specify a specific version of Docker CE:
sudo yum -y install docker-ce-<version>-<release>
Start Docker:
sudo systemctl start docker
Test your Docker CE installation:
sudo docker run hello-world
Procedure for a disposable dev test RHEL 7.3. Never do this in production.
# pre-requisite for container-selinux-2.9-4.el7.noarch.rpm
sudo yum install policycoreutils-python
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.21-1.el7.noarch.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 --enable rhel-7-server-extras-rpms
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
# Install the latest version of Docker CE on RHEL:
sudo yum -y install docker-ce
#Start Docker:
sudo systemctl start docker
#Test your Docker CE installation:
sudo docker run hello-world
# configure Docker to start on boot
sudo systemctl enable docker
# add user to the docker group
sudo usermod -aG docker jethro
# install Docker Compose:
# install python-pip
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install ./epel-release-latest-7.noarch.rpm
sudo yum install -y python-pip
sudo pip install docker-compose
# upgrade your Python packages:
sudo yum upgrade python*
The above assumes you are NOT using a proxy. If you are, you will need to add proxy=http://myproxy:myport
lines pretty much at the end of each block in each file under /etc/yum.repos.d/
, or add it to /etc/yum.conf
.
Hope this helps.