Docker Engine is an open source containerization technology for building and containerizing your applications. This tutorial covers the method to install Docker-CE on RHEL7.6
Installation process:
To check the Installed version of Red Hat
[root@linuxhelp ~]# cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.6 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.6"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.6 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.6:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.6"
Use the below commands to Install the yum-utils packages
[root@linuxhelp ~]# yum install yum-utils
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Package yum-utils-1.1.31-50.el7.noarch already installed and latest version
Nothing to do
Next, we have to install container-selinux package
[root@linuxhelp ~]# yum install http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-1.el7_6.noarch.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
container-selinux-2.107-1.el7_6.noarch.rpm | 39 kB 00:00:10
Examining /var/tmp/yum-root-z8hI3y/container-selinux-2.107-1.el7_6.noarch.rpm: 2:container-selinux-2.107-1.el7_6.noarch
Marking /var/tmp/yum-root-z8hI3y/container-selinux-2.107-1.el7_6.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package container-selinux.noarch 2:2.107-1.el7_6 will be installed
….
….
Running transaction test
Transaction test succeeded
Running transaction
Installing : 2:container-selinux-2.107-1.el7_6.noarch 1/1
Verifying : 2:container-selinux-2.107-1.el7_6.noarch 1/1
Installed:
container-selinux.noarch 2:2.107-1.el7_6
Complete!
After the installation, configure the docker repository
[root@linuxhelp ~]# yum-config-manager \
> --add-repo \
> https://download.docker.com/linux/centos/docker-ce.repo
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
Enable the below repository to install docker-ce
[root@linuxhelp ~]# yum-config-manager --enable docker-ce-nightly docker-ce-test
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
================================================ repo: docker-ce-nightly =================================================
[docker-ce-nightly]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7Server
baseurl = https://download.docker.com/linux/centos/7/x86_64/nightly
cache = 0
cachedir = /var/cache/yum/x86_64/7Server/docker-ce-nightly
check_config_file_age = True
compare_providers_priority = 80
cost = 1000
….
….
sslcacert =
sslclientcert =
sslclientkey =
sslverify = True
throttle = 0
timeout = 30.0
ui_id = docker-ce-test/x86_64
ui_repoid_vars = releasever,
basearch
username =
Now you can install docker using below command
[root@linuxhelp ~]# yum install docker-ce docker-ce-cli containerd.io
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
docker-ce-nightly | 3.5 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
docker-ce-test | 3.5 kB 00:00:00
(1/6): docker-ce-stable/x86_64/updateinfo | 55 B 00:00:00
(2/6): docker-ce-test/x86_64/updateinfo | 55 B 00:00:00
(3/6): docker-ce-nightly/x86_64/updateinfo | 55 B 00:00:00
(4/6): docker-ce-stable/x86_64/primary_db | 45 kB 00:00:00
(5/6): docker-ce-nightly/x86_64/primary_db | 166 kB 00:00:00
(6/6): docker-ce-test/x86_64/primary_db | 118 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.13-3.2.el7 will be installed
---> Package docker-ce.x86_64 3:19.03.13-1.2.beta2.el7 will be installed
…..
….
Running transaction
Installing : 1:docker-ce-cli-19.03.13-1.2.beta2.el7.x86_64 1/3
Installing : containerd.io-1.2.13-3.2.el7.x86_64 2/3
Installing : 3:docker-ce-19.03.13-1.2.beta2.el7.x86_64 3/3
Verifying : containerd.io-1.2.13-3.2.el7.x86_64 1/3
Verifying : 1:docker-ce-cli-19.03.13-1.2.beta2.el7.x86_64 2/3
Verifying : 3:docker-ce-19.03.13-1.2.beta2.el7.x86_64 3/3
Installed:
containerd.io.x86_64 0:1.2.13-3.2.el7 docker-ce.x86_64 3:19.03.13-1.2.beta2.el7
docker-ce-cli.x86_64 1:19.03.13-1.2.beta2.el7
Complete!
After the installation we have to enable and start the docker services
[root@linuxhelp ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@linuxhelp ~]# systemctl start docker
To check the running status of docker
[root@linuxhelp ~]# 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 Tue 2020-08-25 10:50:52 IST; 8s ago
Docs: https://docs.docker.com
Main PID: 69256 (dockerd)
….
….
To use docker-compose we have to download the docker-compose file under /usr/local/bin directory
[root@linuxhelp ~]# curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 638 100 638 0 0 1444 0 --:--:-- --:--:-- --:--:-- 1446
100 11.6M 100 11.6M 0 0 368k 0 0:00:32 0:00:32 --:--:-- 789k
Give the Execute permission for docker-compose file
I am getting Requires: fuse-overlayfs >= 0.7 error while installing docker in RHEL-7.
sudo yum install docker-ce
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* epel: mirrors.syringanetworks.net
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:20.10.2-3.el7 will be installed
--> Processing Dependency: containerd.io >= 1.4.1 for package: 3:docker-ce-20.10.2-3.el7.x86_64
--> Processing Dependency: docker-ce-cli for package: 3:docker-ce-20.10.2-3.el7.x86_64
--> Processing Dependency: docker-ce-rootless-extras for package: 3:docker-ce-20.10.2-3.el7.x86_64
--> Running transaction check
---> Package containerd.io.x86_64 0:1.4.3-3.1.el7 will be installed
---> Package docker-ce-cli.x86_64 1:20.10.2-3.el7 will be installed
---> Package docker-ce-rootless-extras.x86_64 0:20.10.2-3.el7 will be installed
--> Processing Dependency: fuse-overlayfs >= 0.7 for package: docker-ce-rootless-extras-20.10.2-3.el7.x86_64
--> Finished Dependency Resolution
Error: Package: docker-ce-rootless-extras-20.10.2-3.el7.x86_64 (docker-ce-stable)
Requires: fuse-overlayfs >= 0.7
You could try using --skip-broken to work around
I already tried
sudo rpm -Uvh http://mirror.centos.org/centos/7/extras/x86_64/Packages/fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm
Retrieving http://mirror.centos.org/centos/7/extras/x86_64/Packages/fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm
warning: /var/tmp/rpm-tmp.TZLjHD: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
libfuse3.so.3()(64bit) is needed by fuse-overlayfs-0.7.2-6.el7_8.x86_64
libfuse3.so.3(FUSE_3.0)(64bit) is needed by fuse-overlayfs-0.7.2-6.el7_8.x86_64
libfuse3.so.3(FUSE_3.2)(64bit) is needed by fuse-overlayfs-0.7.2-6.el7_8.x86_64
Building on top of @user3495504's answer, what we did to fix the problem was adding an entry on top of the file /etc/yum.repos.d/docker-ce.repo, with this content: