What is Docker?

What is Docker?
  • Docker was first released in March 2013. It was developed by Solomon Hykes and Sebastian Paul.

  • Docker is an open-source centralized Platform designed to create, deploy and run applications.

  • Docker uses containers on the host Operating System (OS) to run applications. It allows applications to use the same Linux kernel as a system in the host computer, rather than creating a whole Virtual OS.

  • We can install docker on any OS Docker engine runs natively on Linux distribution.

  • Docker is written in the 'go' language.

  • Docker is a Tool that performs OS Level Virtualization also known as containerization.

  • Before Docker, many users faced the problem that a particular code was running in the developer's system but not in the user's system.

  • Docker is a set of "Platform as a Service" (PaaS) that uses OS-level virtualization whereas VMware uses Hardware-level virtualization.

  • On the left-hand side, we have Docker's Architecture and on the right-hand side the VM ware Architecture.

  • In VM ware Architecture there is hardware-level virtualization is happening i.e. the infrastructure or hardware is allocated firstly to the Virtual machine say,

    you have 16 GB RAM and 1 TB HDD. In VM ware Architecture we have to give a dedicated 4 GB RAM and 100GB HDD to an instance or VM and then a user can start working on that. Similarly, I can create only 4 instances or VMs. After that, I won't be able to create a new instance as all the resources are taken by VM instances i.e. 16 GB RAM.


Advantages of Docker

  • No Pre-Allocation of RAM

  • CI Efficiency-> Docker enables you to build a container image and use that same image across every step of the deployment process.

  • Less Cost.

  • It is light in Weight.

  • It can run on physical hardware virtual hardware or on cloud.

  • You can re-use the image.

  • It takes very little time to start a container.


Disadvantages of Docker

  • Docker is not a good solution for application that requires a rich GUI.

  • Difficult to manage large amounts of containers.

  • Docker does not provide cross-platform compatibility i.e. if an application is designed to run in a docker container on Windows, then it can't run on Linux or vice-versa

  • Docker is suitable when the development OS and testing OS are the same. If the OS is different, we should use VM.

  • No solution for Data Recovery and Backup.


Components of Docker

  1. Docker Daemon/Engine:-

    • Docker daemon runs on the Host OS.

    • It is responsible for running containers to manage docker services.

    • Docker Daemon can communicate with other daemon

  2. Docker Client:-

    • The Docker client users can interact with the Docker daemon through a client (CLI)

    • The Docker client uses commands and Rest API to communicate with the Docker daemon.

    • When a client runs any server command on the docker client terminal, the client terminal sends these docker commands to the docker daemon

    • Docker client can communicate with more than one daemon.

  3. 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.
  4. Docker Hub/Registry:-

    The Docker registry manages and stores the Docker images.

    There are 2 types of registries in the docker.

    • Public Registry: A public registry is also called a docker hub.

    • Private Registry:- IT is used to share images within the enterprise.

  5. Docker Images:-

    • Docker images are the read-only binary templates used to create docker containers.

    • Single file with all dependencies and configurations required to run a program.

  6. Docker Container:-

    • The container holds the entire package that is needed to run the application.

    • In other words, we can say that the image is a template and the container is a copy of that template.

    • Container is a like a Virtual machine.

    • Images become containers when they run on the Docker engine.


Ways to Create an Image

  1. Take the image from the docker hub.

  2. Create an image from the docker file.

  3. Create images from existing docker containers.

Did you find this article valuable?

Support Chirag Kukreja by becoming a sponsor. Any amount is appreciated!