What is docker?
Docker is one of the most famous and commonly used Open Source containerization technologies. This docker technology is used to build by some features of Linux kernel which Cgroups and namespaces, these features are used to isolate the containers between one another, and that’s why containers can run more processes efficiently.
What is the image or images?
Let me explain the legacy operation and what we do for operating system installation. We should download the image file of the operating system and then we do the installation. If you want to run ubuntu, centos or any other Linux based OS environment you can also download the official predefined and installed application images like WordPress, Nginx, MySQL, Oracle, MongoDB and run that image as a container.
What is Docker Hub?
Docker Hub is a Docker community centralized repository, we can download/pull the image from docker, and also you can save your customized images from your local docker engine to your docker hub account, by this you can download your image from anywhere.
Action 1 - Readiness setup of the Host machine
Prerequisites to install docker in the Redhat Linux.
- If you are a Windows user, you can install docker directly, but we are installing docker in Redhat Linux so you may install VMplayer, Microsoft HyperV or Oracle Virtual box to install RHEL in your windows system.
- You must have at least 4 GB ram of the system to see better performance.
- Subscribe your RHEL OS to install Redhat packages from the RedHat repo using yum or configure yum. Without yum installation, it may take more time to install because of the dependencies.
- You should run the following prerequisite commands if you are not a root user, use sudo before the command to run as superuser.
yum install -y yum-utils \ device-mapper-persistent-data \ lvm2

- To download docker engine from the docker repo, you should configure Docker repo by using below command
yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
- The below command is used to enable more rpm dependencies to install from RHELl repo and docker repo. Without enabling you can get an error to download the docker engine.
subscription-manager repos --enable=rhel-7-server-extras-rpms

Action 2 - Docker setup and download the image and run as a container
After completing the pre-requisites, to install docker by running the following command
yum install docker-ce docker-ce-cli containerd.io
After completing the installation you can see the below completion snapshot.
To Run the Docker, run the command systemctl start docker
After starting the docker service you need to download the docker image, so to pull the ubuntu image run the command docker pull ubuntu
To check image downloaded or not run the command → docker images
To run the downloaded image as container run the command docker run -it -d ubuntu
To list the container run the command docker ps
To login to the image run the command with container ID docker exec -it container ID bash


Rushi MehtaPosted Jan 6, 2020, 2:54 AM
Useful Article