Step 1 – Enable Docker Repository

First of all, add the official Docker yum repository on your CentOS 8 system.

Step 2 – Install Docker on CentOS 8

After adding the yum repository to your CentOS system, update the yum cache by executing the following command. Now install docker community edition package to install docker on your system. This is installed many of the required decencies on your system. The –nobest option instruct installer to not to limit for best candidate package dependency.

Step 3 – Manage Docker Service

Once the Docker successfully installed on your CentOS 8 system. Use the following commands to enable Docker serivce and start it. Then check the Docker service status. Result Docker has been installed and running on your CentOS 8 operating system. You can visit our Docker tutorial section to work with Docker containers.

Step 4 – Test Docker on CentOS 8

Search Docker Images

First of all search Docker container images from Docker hub. For example, below command will search all images with Ubuntu and list as output

Download Docker Images

Now download the Docker container with name Ubuntu on your local system using following commands. Output: Now make sure that above images have been downloaded successfully on your system. Below command list all images. Output:

Run Hello-World Docker Container

Use the following command to run a hello-world docker container. This container will print a message on screen and exit immediately. You will see the results like below screenshot. The success message shows that Docker service is properly installed on your CentOS 8 system.

How to Install Docker on CentOS RHEL 8   TecAdmin - 62