How to install Docker on RHEL 8 beta

Introduction

This post will guide you about the steps required to get started with Docker on RHEL 8 beta system. RHEL 8 beta was announced a few months back and it is available to download for testers and developers, It comes with a lot of advancement and new features and If you want to install and explore RHEL 8 you can read our old post that shows the detailed steps of RHEL 8 installation on VMware workstation
One of the new features added in RHEL 8 is Containers without daemons. Buildah and Podman can help you build containers without any requirement of Dockers.
There are two versions of Dockers available: Docker CE [Community edition] and Docker EE [Enterprise Edition].
Well, if you are wondering of RHEL 8 Beta supports docker? There is no official documentation regarding the installation of Dockers on RHEL 8 beta, we tested installation of Docker CE on RHEL 8 beta to play with dockers on RHEL 8.

Steps of Installing Docker CE on RHEL 8 beta

Before installing Docker CE on a machine, we need to setup the docker repository. Once this step is done, we can install Docker from the repository.

1. Set up the repository

Install required packages, dnf-utils, device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver.
Note that : DNF (dandified yum)is used as package management utility in RHEL 8.
# dnf install -y dnf-utils \
  device-mapper-persistent-data \
  lvm2
Use the following command to set up the repository.
#  dnf config-manager \ 
  --add-repo \
  https://download.docker.com/linux/centos/docker-ce.repo
Now, the docker ce repository is set up, you can check using dnf repolist or yum repolist

2. Install Docker CE

You can install the latest version of the docker ce using below command.
# dnf install docker-ce
While installing, if you are prompted to accept the GPG key, accept the same by entering y
Note: We encountered below error while running the install command for the first time. We re-ran the install command, it did not appear and prompt for accepting gpg key came next and after entering y, the installation went smooth and was finished in about a minute.
Curl error (6): Couldn’t resolve host name for https://download.docker.com/linux/centos/gpg [Could not resolve host: download.docker.com]

Once installed, you will see the download complete message with the package details that are installed.

Next step is to start and enable docker using systemctl
# systemctl start docker
# systemctl enable docker
Finally, you are done with the Docker CE installation on your RHEL 8 machine, now lets verify that it is installed correctly by running the hello-world image.

That’s all for this post, hope you are able to install docker on your RedHat Linux 8 machine.
If you have thoughts on this, please feel free to comment below.