Introduction
As the official Docker repository for RHEL 9.x has not been updated, So you will face issues while installing it.
In this article I will tell you how to install Docker in RHEL 9.x with an alternate method.
Setting up Docker Repository
If you use the following commands from docker website link https://docs.docker.com/engine/install/rhel/
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/rhel/docker-ce.repo
You might get the following error while trying to set up the official RHEL Docker repository in RHEL 9.x
To fix the above error, try to setup CentOS docker repository in RHEL 9.x by following the commands
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
Installing Docker
Use the following command to install Docker
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
This command installs the docker, but it does not start. So to start docker use the following command
sudo systemctl start docker
To verify Docker installation is successful try running hello-world image.
sudo docker run hello-world
This command runs the container and prints the message and exits.
Conclusion
By setting up CentOS Docker repository in RHEL 9.x you can install the Docker engine on RHEL 9.x.