What does Docker mean?

Vishugoyal
5 min readMay 22, 2021

--

  • Docker is a platform to develop, deploy, and run applications inside containers. Docker is essentially synonymous with containerization. If you’re a current or aspiring software developer or data scientist, Docker is in your future.
  • It helps to launch your OS within a sec.
  • It does not require 1–2 GiB’s space to run your OS, it will require only few MiB’s to run properly. ( Because it will use resource of your base OS)

Docker is being used in the following areas:

  • Simplifying configuration: Docker lets you put your environment and configuration into code and deploy it.
  • Code Pipeline Management: There are different systems used for development and production. As the code travels from…
  • Developer Productivity: Using Docker for development gives us two things — We’re closer to production and development…
  • Application Isolation: As containers are applications wrapped together with all dependencies, your apps are isolated.

Install Docker On RHEL8

In RHEL 8(Red Hat Enterprise Linux 8) Docker is Community Edition is not supported you have to buy a licence and install Enterprise Edition but i will show you trick to install Docker Community Edition in RHEL8

Note:- Make sure your yum is configured properly

Let’s Start

  1. Start your system or VM and Open Your Linux terminal

2. GOTO yum.repos.d by this command

cd /etc/yum.repos.d/

3. create a repo by this command

gedit docker.repo or vim docker.repo or vi docker.repo

4. Copy this in file or type

[docker]

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

gpgcheck=0

5. save the file

6. run this command to install the docker community edition

yum install docker-ce — nobest -y

7. Check the status of your docker service by this command

systemctl status docker.service

8. It is inactive dead because we install it now, so we have to start this service

Now we will start and enable our docker service

systemctl start docker.service

systemctl enable docker.service

Note:- If we use systemctl start docker.service this service will stop automatically when we terminate, restart or power off our RHEL system to enable make this service permanent so that we use this cmd systemctl enable docker.service .

Now the most useful cmd given below:

  • docker --help ⇾ It will help you and show all the options you have to use it.
  • docker ps ⇾ It shows how many OS launches we have right now in our VM.
  • docker images ⇾ It shows how many OS launches we have right now in our VM.
  • docker pull ⇾ It helps to download the images from the hub.docker.com (repository) to pull there in our local OS. For e.g. (docker pull centos:7)
  • docker run ⇾ It helps to run the local images in your VM. For e.g. (docker run -it centos:7) we use “ -it ” in the cmd to the more interactive terminal we can use it.
  • docker ps -a ⇾ It will help you to tell all the history of the container will start or shut down records.
  • docker start <Id/container_name> ⇾ It helps you to start the docker in the background, If you want to go inside the container then use the just next cmd to move inside the running container.
  • docker attach <Id/container_name> ⇾ It will help you to move inside the running container which is already running in the background.
  • docker run -it --name <name> centos:7 ⇾ It sets your own name of the container at the running time.
  • docker stop <Id/container_name> ⇾ It will help you to stop the running container not terminated the container if you save the data it will remain save in your container OS (not to worry about that data after running that cmd)
  • docker rmi <Id/container_name> ⇾ It will help you to delete the container, but you should confirm that the particular container is not running at that time when you delete or terminate it (After running this cmd your data is a permanent loss.)
  • ctrl + pq ⇾ If you want to move out the running container without stop or terminate it then use these keyboard keys to move out.
  • docker run -it --name os1 centos:7 date ⇾ If you have only wanted to run date or any other cmd in your container then just type after the docker run cmd it will run your written cmd automatically with one click. First, it will launch OS then it will run date cmd automatically.
  • docker run -it --name os1 --rm centos:7 ifconfig ⇾It first launch your container then run the ifconfig cmd then after work or cmd run properly then it will terminate automatically because of “--rm” option.

How to create our own Docker on hub. docker.com.

There are two ways to create your own docker file :

  • Commit method
  • Docker file method

If you have any problem to do these practical or any other query then contact DM to me 7453010168 (Whatsapp)

--

--

Vishugoyal

I am pursiing B-tech. and also very fond of learning new technology under the guidance of Vimal Daga sir (World Record Holder).