How to Install Docker in RHEL8 and Their Setups:-

Ashutosh Kaushik
2 min readMay 27, 2021

--

Step:1

Go to Docker hub and copy the link of this .

Step:2

Go to your os and go the the file yum by using this command “ cd

/etc/yum.repos.d/”

Step:3
Create a directory by any name in my case docker1.repo and write the code in that exact like this

[docker]

baseurl=https://download.docker.com/linux/centos/7/x86_64/stable/

gpgcheck=0

And enter ctrl+c to out, write :wq and out of Vim.

Step:4

Run the command “gpgcheck=0"

To update the repolist use the command “yum repolist"

Step:5

Now you will see the docker repo comes up.

Now final step would be to install the docker use the command “yum install docker-ce — nobest” for the 18th version of docker.

Step:6

For checking docker is installed or not use the command “rpm -q docker-ce"

After this to start the docker service use the command “systemctl start docker"

To see the docker running or not use the command “systemctl status docker"

In this case you will see service is disabled so for enabling or

To run the permanently docker use the command “systemctl enable docker”

Now if you wants to pull any image in my case I pulled CentOS image by using the command “docker pull centos:latest" it will download latest version of CentOS.

For run the any container use the command “docker run -it name container name image name" for example “docker run -it name myos1 centos:latest"

I think it will helpful for you to installing docker and running the container.

Thanks for Reading 🤩

--

--

No responses yet