Wednesday | 28 FEB 2024
[ previous ]
[ next ]

Installing Docker on RHEL 7.4

Date: 2022-11-19

This is a bit roundabout and requires some fiddling with the repo files as docker the company seems to have moved some of the rhel files around.

The first step is to add the docker repo.

yum install -y yum-utils
yum-config-manager --add-repo

We need to do two things, the first is to add a repository to get some extra utilities that docker requires. This will be a centos repo.

The second thing is we need to change the rhel urls to centos urls. Docker has moved the rhel files but not the centos files.

Add the following to /etc/yum.repos.d/docker-ce.repo.

name=Centos extras - $basearch

This will let us download the extra utilities needed to install docker.

Next do a search and replace of rhel in the file for centos.$releasever/debug-$basearch/stable

Should be changed to:$releasever/debug-$basearch/stable

This will be across the board for all the urls in the file.

Now we can install docker.

yum install docker-ce docker-ce-cli docker-compose-plugin

Once installed, we can start and enable docker.

systemctl start docker
systemctl enable docker

We can test docker by pulling a hello world image.

docker run hello-world

With that we should now have docker installed and ready to go!