Docker is one of the hottest topics in the software technology industry. It was first introduced in March 2013 and developed by Kamel Founadi, Solomon Hykes, and Sebastien Pahl. Docker is written by Go programming language
. Here, I will try my best to introduce docker's main concepts to you very easily. First of all, you have to know about Linux. If you already know about Linux's basic commands so you're welcome. We can install docker on any OS but docker-engine runs natively on Linux distribution.
But don't worry I will teach you Linux's basic commands.๐คฉ
So, what is docker?
Docker is an open-source centralized platform designed to create, deploy and run applications. Docker is a set of platform as a service ( PaaS ) that uses OS level virtualization.
Do you understand? ๐
Okay have a look, by using docker we can share our applications or projects very easily with others. Sometimes our development environment and other people or team's environments are different. So that, they can't run your project as you can from your local environment. Because maybe other environments have missed some dependencies that are required to run your application. This is a very panicked situation. And to resolve this situation Docker has come. Docker builds a container with necessary dependencies. Each container treats as our local machine.
Docker's concept
Docker's main concept comes from Virtual Machine. Docker is a tool that performs OS ( operating System ) level virtualization, also known as containerization. And every docker's VM is called a container. Docker's concept is different from actual VM ( virtual machine ). VM uses hardware-level virtualization.
OS level virtualization
: A virtual machine concept that uses mainly operating systems. It has no direct relation to the host ( hardware resources for example RAM, processor, hard disk, etc ). When it's needed, that time only uses host resources. It does not block host resources. It's no need for brand new operating system installation panic because it adopts the main OS as needed. That's why Docker container is very lightweight.
hardware-level virtualization
: Virtual Machine ( like VMware ) blocks defined host resources that's why we can able to create a limited number of VM on our machine. It has a direct relationship with host resources. Else, every VM needs to install individual a brand new OS and other necessary applications to run our projects or applications. It is a very time-consuming task. For these panic reasons, docker has come into the picture.๐ฅณ๐ฅ
Components of docker:
Docker container
: A container is just like a Virtual Machine. it holds the entire packages that are needed to run the application. A container also holds OS but this OS is very lightweight. Some people say that container has no OS but practically container holds OS. It adopts necessary files from the docker daemon and base OS. First of all, the docker daemon search files locally but if not found, it pulls files from the docker hub.
Docker engine
: Docker engine is called the docker daemon. Docker daemon runs on the host OS. It is responsible for running docker containers and managing docker services. Docker daemon holds all images to create a container.
docker image
: Docker images are the read-only binary templates used to create docker containers. An image holds all packages. To create a container, an image is needed. We can get an image in 3 ways:-
- By taking an image from the docker hub.
- By creating an image from Dockerfile.
- By creating an image from exiting docker container.
Docker client
: Docker users can interact with docker daemon through a client. Docker client uses CLI (Command line interface) and Rest API (Application Programming Interface) to communicate with docker daemon. When a user runs any command on the docker client terminal, the docker client terminal sends it to the docker daemon.
Docker host
: Docker host is used to provide an environment to execute and run applications. It contains the docker daemon, images, containers, networks and storage. Host means our hardware section.
So, why should we learn docker?
I have already discussed actually docker's necessity. So, in a short form --
- To solve our application's dependencies problem
- It doesn't pre-allocate RAM.
- CI ( continuous Integration ) efficiency.
- less cost ( hardware/resources are used as needed )
- It is light in weight.
- It can run on physical h/w or virtual machine or even on the cloud.
- You can re-use the image.
- It takes very less time to create a container.
- Easy to create, deploy and run application.
- Docker container holds your all software development packages and after making a docker image, you can share it with everyone๐ฅ
Enough talks, let's code ๐
To work with docker we need to install docker in our system. Download or use command lines from this click here to install docker and follow instructions as said there. Very easy process, doesn't it? ๐
- After successfully install open your terminal or cmd(windows user)
docker --version
It will show a version number. Congratulations!๐ฅณ docker installation has been successfully done.
- If it doesn't work, don't worry. You have to turn on docker's service. Open your terminal and type
service docker start
After check status
service docker status
Or
docker --version
Now you're ready to go into docker's worldโ๏ธ๐
Top comments (0)