Docker CE is not officially supported on RHEL but you can get the latest Docker CE installed on it.
Here are the steps.
Step 1 : Install yum-utils and epel-release.
yum-utils
# yum install -y yum-utils
epel-release
# wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
--2018-03-24 10:28:49-- http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Resolving dl.fedoraproject.org (dl.fedoraproject.org)... 209.132.181.25, 209.132.181.23, 209.132.181.24
Connecting to dl.fedoraproject.org (dl.fedoraproject.org)|209.132.181.25|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15080 (15K) [application/x-rpm]
Saving to: ‘epel-release-latest-7.noarch.rpm’
100%[==========================================================================================================================>] 15,080 57.0KB/s in 0.3s
2018-03-24 10:28:50 (57.0 KB/s) - ‘epel-release-latest-7.noarch.rpm’ saved [15080/15080]
#
# rpm -ivh epel-release-latest-7.noarch.rpm
Step 2 : Add Docker CE to yum repos.
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Before docker-ce installation, we should install container-selinux. If not docker-ce will fail due to container-selinux dependencies.
Also, if epel-release package not installed, then also docker-ce will fail with below error.
Error: Package: docker-ce-18.03.0.ce-1.el7.centos.x86_64 (docker-ce-stable) Requires: pigz
Step 3: Install container-selinux package.
# yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.33-1.git86f33cd.el7.noarch.rpm
Step 4: Install Docker CE
# yum install -y docker-ce
# docker --version Docker version 18.03.0-ce, build 0520e24 #
Step 5: Restart docker service and enable it.
# systemctl restart docker # systemctl enable docker Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
Step 5: Now run nginx container to test.
# docker run --name webserver -d -p 9090:80 nginx
Now check in web browser with below url
Nice easily for installation
LikeLiked by 2 people
epel-release is actually (to follow nice yummy commands) as easy as:
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
LikeLiked by 1 person
Hello, Please help! I stuck in step 3 with this below err
“Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Cannot open: http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.33-1.git86f33cd.el7.noarch.rpm. Skipping.
Error: Nothing to do”
LikeLiked by 1 person
Replace by the following
yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.42-1.gitad8f0f7.el7.noarch.rpm
LikeLiked by 2 people
Hi Zor,
Are you installing docker ce on cloud or in your local machine ?
If you are installing in your local machine, as the RedHat is not a free distribution, we need to purchase a licence and activate it.
If you want to try in cloud, signup to AWS Free tier account and create VM with redhat 7 image.
Once your task done, terminate the VM to avoid charges.
LikeLiked by 1 person
This does not work for me unless I explicitly locate and install pigz-2.3.4-1.el7.x86_64.rpm
LikeLike
This does not work unless I explicitly get a copy of pigz-2.3.4-1.el7.x86_64.rpm and rpm -i it …
LikeLike