Unable to install docker on rhel 8 linux

Latest response

=> Unable to install docker on rhel 8 - getting following error

[root@localhost certs]# sudo yum install docker-ce docker-ce-cli containerd.io
Updating Subscription Management repositories.
Docker CE Stable - x86_64 310 B/s | 381 B 00:01
Errors during downloading metadata for repository 'docker-ce-stable':
- Status code: 404 for https://download.docker.com/linux/rhel/8/x86_64/stable/repodata/repomd.xml (IP: 13.224.20.74)
Error: Failed to download metadata for repo 'docker-ce-stable': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

Responses

Hi,

i think the repourl is wrong. The dockerrepo only provides "centos" (not rhel) as distribution. The correct repomd.xml URL is https://download.docker.com/linux/centos/8/x86_64/stable/repodata/repomd.xml

Just add the following part to your yum.repos.d-directory should work. (delete all pre existing docker related entries)

[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

kind regards, Sascha