Background
If you’ve searched google to figure out how to install Docker-CE on RHEL 8, you may have been led to this very popular article: LinuxConfig.org: How to Install Docker on RHEL 8. If you’d read closely, you might have read a false statement which says, “What version to install? Well, Red Hat seems to have somehow blocked the installation of containerd.io > 1.2.0-3.el7, which is a dependency of docker-ce.” This statement is completely wrong. What’s going on here is two fold:
- This article shows the user how to install the wrong version of Docker-CE. It demonstrates how to install the version for CentOS 7, not CentOS 8 (which does work).
- This article does not verify that the container-tools module is uninstalled
To be fair, the upstream Docker CE docs also demonstrate how to install the version made for CentOS 7, so it’s kind of understandable that they are wrong on LinuxConfig.org. Let’s dig into how to install the right version, which works on RHEL 8.
Install Docker CE
First, verify that the container-tools module is uninstalled:
yum module remove container-tools
Now, add the Docker CE repository:
yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
Finally, install Docker CE:
yum install docker-ce
Conclusion
That’s it. That’s all it takes. Docker CE will install and run just fine on RHEL 8. Red Hat did not, in fact, figure out some way to block the installation of Docker on RHEL 8. That said, Red Hat does recommend Podman on RHEL 8. For more information, check out this blog: RHEL 8 enables containers with the tools of software craftsmanship. As always, leave any questions or comments you have below, and feel free to follow me on Twitter: @fatherlinux
That must have been changed recently, which is good. At the time of this writing, there was a hard coded 7.
I think that you dont have to use the [sed] command .
I opened the repo file and found its uses these urls :
https://download.docker.com/linux/centos/$releasever/$basearch/stable
Which will automatically determine your centos version and your cpu architect .
Thank you! I was starting to bang my head on the wall! This post is on point as I found the mentioned article and couldnt get it installed until I utiized the sed for replacing the 7 with 8 as I intentionally didnt install the container tools on server install.
No longer seems to work, containerd now has a conflict and does not seem to want to install without using –nobest option.
I just tested it and it works for me. Please share the what you are seeing. I’m thinking that you didn’t uninstall runc or one of the dependencies.
Installed:
container-selinux-2:2.167.0-1.module+el8.4.0+12646+b6fd1bdf.noarch containerd.io-1.4.9-3.1.el8.x86_64
docker-ce-3:20.10.8-3.el8.x86_64 docker-ce-cli-1:20.10.8-3.el8.x86_64
docker-ce-rootless-extras-20.10.8-3.el8.x86_64 docker-scan-plugin-0.8.0-3.el8.x86_64
fuse-overlayfs-1.6-1.module+el8.4.0+11822+6cc1e7d7.x86_64 fuse3-3.2.1-12.el8.x86_64
fuse3-libs-3.2.1-12.el8.x86_64 libcgroup-0.41-19.el8.x86_64
libslirp-4.3.1-1.module+el8.4.0+11822+6cc1e7d7.x86_64 slirp4netns-1.1.8-1.module+el8.4.0+11822+6cc1e7d7.x86_64
Complete!
I had the same problem. I had to uninstall all podman stuff before trying again: rpm -qa | grep podman | xargs yum -y autoremove
oBuTr471b above discusses sed
you still may need sed to change centos to rhel in url(s) the .repo file
docker only supports s370 architecture for rhel8 i believe