cancel
Showing results for 
Search instead for 
Did you mean: 
Denzil
Mission Specialist
Mission Specialist
  • 1,453 Views

How to install Docker in Red Hat 8.0

Jump to solution

Good day to you,

may you be good  enough to walk me though for a Docket installation.

 

Kind Regards

Denzil Peiris
6 Solutions

Accepted Solutions
Travis
Moderator
Moderator
  • 649 Views

@Denzil -

You can use Docker, but you would be much better off using Podman, It is Red Hat's docker equivalent and bundled with the RHEL distribution. This is also what we teach (podman) in the RHCSA courses. As of RHEL8, podman was chosen as the default container runtime and management in RHEL replacing docker which was used in versions prior to RHEL8. Again with your system already having issues with repositories and installing RPMs increasing the number of repositories where you are obtaining packages will result in more issues with debugging and getting things to work, so fair warning here. There is definitely nothing wrong with using docker if that is what you really want, but if you are wanting to experiment with containers using built-in RHEL tools, podman is your best bet with RHEL8 or higher and it also gets you ready if you ever want to go to OpenShift or Kubernetes.

Of course another possibly easier option is Docker Desktop or Podman Desktop as that will run on Linux, MacOS, and Windows.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training

View solution in original post

Chetan_Tiwary_
Community Manager
Community Manager
  • 637 Views

Agree , as Podman is also quite intensively covered in RH courses especially for beginners - switching to Podman is benefecial. 

View solution in original post

Travis
Moderator
Moderator
  • 1,076 Views

@Denzil -

This is covered in some of our basic administration courses, but again, since it is part of RHEL ...

yum install podman

I know you want to learn cloud, but cloud is a "generic" term. I think in your instance what you might want to learn for cloud is "containers" which would be a generic term. 

The two basic Linux runtimes and management for containers are Docker and Podman. Both essentially do the same thing, but Docker has been around slightly longer. So sometimes when people are refering to using "Docker" and running a "Docker image" they often are referring to running a container image.

It would be like someone saying they run their service in the cloud on AWS, but that isn't actually where it is ... it might be Azure, Google Cloud, or somewhere else, but AWS is what they new the most about so instead of saying cloud, they say everything runs on AWS.

One of the things I did on some of my systems when Red Hat first switched to Podman was I had to make a command alias to where the docker command actually aliased Podman. I did that because 95% of everything in command syntax and 100% of the most common things for running containers is the same syntax, you just substitute the name of the command.

In my opinion, if you are wanting to learn containers for the cloud (which I think is your goal) Podman is the superior solution because it manages the pods (again a new term) which could be a group of containers and services and this is the magic behind Kubernetes and OpenShift and what easiliy allows your multi-container services to work.

One thing to keep in mind ... and I'm wearing the T-shirt today (actually) with the saying on it ... Containers are Linux. You will be best served to understand how to use Linux basics and fundamentals before running and building containers. It will make things much easier to understand and absorb. It is one thing to find an article and run XXX or YYY container for a reason, but if you want to learn, build, maintain, control, and administer container and truly understand a good foundation in Linux is what you need.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training

View solution in original post

Travis
Moderator
Moderator
  • 1,049 Views

@Denzil -

One of the huge and main reasons I mentioned using Podman is it is a built-in component of RHEL. If you only have RHEL installed and no other channels and software, there will never be issues (***) with installing a RHEL package from BaseOS or Appstream. Once you start installing 3rd party software and EPEL, all bets are off as you can accidentally replace Red Hat software with a package of the same name and newer version. It will install dependencies because that is what RPMs do ... look for software needed and attempt to resolve. Now when you update RHEL with a yum update it tries to install new pacakges but you have some things from upstream and dependencies that get broken because a new package isn't released or you have a combination of RHEL and upstream packages that don't mix well. I'm not saying it can't be done, but you should do so with caution. When I was in consulting, I had a customer that subscribed to EPEL to install individual packages they needed (that's OK) but they left the system subscribed to all EPEL channels and did a yum update now because they were using RHEL and products like Satellite and OpenStack, versions of PIP and Python were replaced and upgraded with newer non-Red Hat versions and that broke things with the application because now we had newer versions of files, and no longer had the versions required to support the layered RHEL product as it was replaced accidentally by the upstream.

I had specifically advised against Docker installation beause of that is it will at times have external dependencies and could cause version and RPM conflicts with RHEL. Again, the podman installation will allow you to do whatever you want with the container and should be very safe and easy for you to install. If you want to play with the containers in Windows, you can also do that by installing Podman Desktop. 

https://podman-desktop.io/

https://developers.redhat.com/products/podman-desktop/overview?sc_cid=RHCTG0240000434049&gad_source=...

 

I will also leave you with this for your learning ...

I had mentioned Red Hat Developer network and the Red Hat Developer subscription. I'm once again recommending this as a wonderful free source of information, software, and learning. There are some "lessons" that will teach targetted items. It also allows you to download the RHEL versions for installation and gives you the free developer subscription entitlements. There are also often eBooks and blogs to help you learn things and cheatsheets available.

https://developers.redhat.com/learn/rhel

https://developers.redhat.com/topics/containers

 

Red Hat provides a ton of free resources, including books. I've given a link to the Podman book as well as a bunch of cheat sheets. These aren't meant to replace formal training or a complete book, but will be useful as reference materials for providing insight. I often provided these to students when I was teaching Red Hat courses and these should help you as you are learning (hopefully they can be used as references, refreshers, and guides).

Excellent Book on Podmanhttps://developers.redhat.com/e-books/podman-action

Cheat Sheets:

https://developers.redhat.com/cheat-sheets/linux-commands-cheat-sheet

https://developers.redhat.com/cheat-sheets/red-hat-enterprise-linux-in-wsl

https://developers.redhat.com/cheat-sheets/red-hat-enterprise-linux-10-cheat-sheet

https://developers.redhat.com/cheat-sheets/advanced-linux-commands

https://developers.redhat.com/cheat-sheets/podman-cheat-sheet

https://developers.redhat.com/cheat-sheets/red-hat-enterprise-linux-8

https://developers.redhat.com/cheat-sheets/bash-shell-cheat-sheet

https://developers.redhat.com/cheat-sheets/intermediate-linux-commands-cheat-sheet

https://developers.redhat.com/cheat-sheets/systemd-commands-cheat-sheet

https://developers.redhat.com/cheat-sheets/containers

 

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training

View solution in original post

Travis
Moderator
Moderator
  • 991 Views

@Denzil -

Great to hear and I'm not too worried about Python. I used that as a practical example. The reason it caused more problems is our layered applications Red Hat Satellite, OpenStack, etc. have very strict requirements on supported versions and tools that build on that. You have a more plain installation and I doubt a ton of other Red Hat paid products. Python doesn't interact with Podman per-se, so I don't think you will have any issue. You will know once you do a yum install podman.

The final piece of information I will give you is that you can see which RPM a binary was installed from, so you can identify where and how Python was installed, but again, for you it shouldn't matter.

$ which LogViewer
/usr/bin/LogViewer

$ rpm -qf /usr/bin/LogViewer
LogViewer-4.0.5-0.x86_64

$ dnf info LogViewer-4.0.5-0.x86_64
Repositories loaded.
Installed packages
Name            : LogViewer
Epoch           : 0
Version         : 4.0.5
Release         : 0
Architecture    : x86_64
Installed size  : 72.1 MiB
Source          : LogViewer-4.0.5-0.src.rpm
From repository : copr:copr.fedorainfracloud.org:tmichett:LogViewer

$ dnf info LogViewer
Updating and loading repositories:
Repositories loaded.
Installed packages
Name            : LogViewer
Epoch           : 0
Version         : 4.0.5
Release         : 0
Architecture    : x86_64
Installed size  : 72.1 MiB
Source          : LogViewer-4.0.5-0.src.rpm
From repository : copr:copr.fedorainfracloud.org:tmichett:LogViewer

This can give you an idea of how a binary file got installed, which RPM installed it, and then using DNF or YUM, it will give you the repostory that has the file available. Using that information but substituting with Python or Python3 (whatever you use as your Python command) will help you determine where this stuff came from, so that is the last piece of information I can provide to help you with your questions.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training

View solution in original post

0 Kudos
Travis
Moderator
Moderator
  • 715 Views

@Denzil -

I have no idea where I referred to the "flash" disk, but I'm sure it was relation to Fedora Live and my Fedora Remix. I'm almost certain I gave you the link to my Github information, but I roll my own custom Fedora Remix. So it is essentially Fedora Workstation with a ton of added tools already pre-installed.

https://tmichett.github.io/Fedora_Remix/

I know I directed you directly to Fedora too. Both ISOs would be a live bootable USB disk that allows you to work with Linux without installing, but you also have the ability to mount partitions in the graphical environment. I also remember mentioning that you don't need to build your own and you could download mine. That Github page has a link to a GoogleDrive where I've uploaded various versions of my Fedora Reminx. The latest one is 

https://drive.google.com/file/d/1GBM2OzaIG4f33dDUomTs0t_J3zxiMfDO/view?usp=drive_link

Which is Fedora 42 with a bunch of preinstalled applications and utilities. This would require a 16GB/32GB USB flash drive to provide the best experience.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training

View solution in original post

22 Replies
Blue_bird
Starfighter Starfighter
Starfighter
  • 727 Views

https://docs.docker.com/engine/install/rhel/#prerequisites

I hope the above documentation guides you to install..! @Denzil 

 

Thanks

Denzil
Mission Specialist
Mission Specialist
  • 718 Views

Good day to you @Blue_bird 

Thank you for that.

I did the first part, and it remove some inatallations.

sudo dnf remove docker \                  docker-client \                  docker-client-latest \                  docker-common \                  docker-latest \                  docker-latest-logrotate \                  docker-logrotate \                  docker-engine \                  podman \                  runc

 

The document further advises " Images, containers, volumes, and networks stored in /var/lib/docker/ aren't automatically removed when you uninstall Docker"

If that is the case, how may I go about it?

 

Then again, it refers to "

sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo

 

What does this do? Isn't there a way to install Docket away from a "REPO"

 

 

 

Kind Regards,

 

Denzil

 

Denzil Peiris
Denzil
Mission Specialist
Mission Specialist
  • 712 Views

Hello @Blue_bird 

In other words, what I am seeking is, is the link you have sent me happen to be a proven, tested solution?

 

Kind Regards,

 

Denzil

Denzil Peiris
Chetan_Tiwary_
Community Manager
Community Manager
  • 678 Views

@Denzil yes that is an official docker doc : https://docs.docker.com/engine/install/rhel/ 

Please follow the steps there carefully. 

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 677 Views

@Denzil The doc is quite self explanatory. Once you removed the conflicting packages - please proceed to next step that is to configure the repository so that you can download and update docker :

sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo

post this you can install docker using :

sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

and then start docker engine :

sudo systemctl enable --now docker

verify installation by running a simple hello world image :

sudo docker run hello-world
Denzil
Mission Specialist
Mission Specialist
  • 627 Views

Good day to you @Chetan_Tiwary_ 

 

Thank you very much for that.

I shall try these steps and in the event I get stuck, I will get back to you.

By the way, in the event IF the any of the steps does not get execuited, I will have a half baked cake! In such event how may I uninstall? 

I would appreciate your professional advise.

 

Kind Regards,

 

Denzil

Denzil Peiris
0 Kudos
Travis
Moderator
Moderator
  • 650 Views

@Denzil -

You can use Docker, but you would be much better off using Podman, It is Red Hat's docker equivalent and bundled with the RHEL distribution. This is also what we teach (podman) in the RHCSA courses. As of RHEL8, podman was chosen as the default container runtime and management in RHEL replacing docker which was used in versions prior to RHEL8. Again with your system already having issues with repositories and installing RPMs increasing the number of repositories where you are obtaining packages will result in more issues with debugging and getting things to work, so fair warning here. There is definitely nothing wrong with using docker if that is what you really want, but if you are wanting to experiment with containers using built-in RHEL tools, podman is your best bet with RHEL8 or higher and it also gets you ready if you ever want to go to OpenShift or Kubernetes.

Of course another possibly easier option is Docker Desktop or Podman Desktop as that will run on Linux, MacOS, and Windows.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
Chetan_Tiwary_
Community Manager
Community Manager
  • 638 Views

Agree , as Podman is also quite intensively covered in RH courses especially for beginners - switching to Podman is benefecial. 

Denzil
Mission Specialist
Mission Specialist
  • 623 Views

Hello @Chetan_Tiwary_ 

 

Thank you for that! Especially mentioning "beginners"

 

 

Kind Regards,

 

Denzil

Denzil Peiris
0 Kudos
Join the discussion
You must log in to join this conversation.