Getting Started with Docker

Tushar Rajpoot
3 min readAug 26, 2022

What is Hypervisor?

A hypervisor is computer software, firmware or hardware that creates and runs virtual machines. A computer on which a hypervisor runs one or more virtual machines is called a host machine, and each virtual machine is called a guest machine.

What is a virtual machine?

A Virtual Machine (VM) is a compute resource that uses software instead of a physical computer to run programs and deploy apps. … Each virtual machine runs its own operating system and functions separately from the other VMs, even when they are all running on the same host.

What is docker?

Docker is an advanced version of virtualization.

The main work of docker is containerization.

keywords of docker are:

develop, ship, and run anywhere.

We can run multiple containers on one host, Container does not have any operating system

Theory about docker

  • Docker was first released in march 2013, developed by Solomon hykes and Sebastian Pahl.
  • Docker is an open source centralized platform designed to create, deploy and run applications
  • Docker uses a container on the host OS and runs the application. It allows applications to use the same Linux kernel
  • as a system on the host computer, rather than creating a whole virtual OS
  • We can install docker-engine on any OS, but the docker engine only runs natively on Linux distributions
  • Docker is written in the Go language
  • Docker is a tool that performs OS-level virtualization also called containerization
  • Before docker, many users faced problems that a particular code is running in the developer’s system but not in the user’s system
  • Docker is a set of platforms as a service that uses OS-level virtualization whereas VMWARE uses hardware-level virtualization.
  • Docker provides a type of platform for our application to be executed.

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 stage of the deployment process.
  • Less Cost
  • It is light in weight.
  • It can run on physical hardware/virtual hardware/ or on the cloud.
  • You can re-use the image.
  • It took very less time to create a container.
  • IMAGE — — -RUN — — → Container Container — — -Make/share — — -> IMAGE
  • The container is a running state of the image. We can make changes in containers not in images.

Disadvantages of Docker

  • Docker is not a good solution for applications that required rich GUI
  • Difficult to manage a large amount of containers
  • Docker doesn’t provide cross-platform compatibility means 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.

Docker Ecosystem

  • Docker client
  • Docker Hub
  • Docker Daemon or Docker Server or Docker engine
  • Docker images
  • Docker compose

Docker Daemon

  • Docker daemon runs on the Host OS.
  • It is responsible for running containers to manage docker services.
  • Docker daemon can communicate with other daemons.

Docker Client

  • Docker users can interact with docker daemon through a client.
  • Docker client uses commands and Rest APIs to communicate with the docker daemon.
  • When a client runs any server command on the docker client terminal, the client terminal sends these commands to the docker daemon.
  • It is possible for docker client to communicate with more than one daemon.

Docker host(not a part of ecosystem)

  • Docker host is used to provide an environment to execute and run applications. It contains the docker daemon, images, containers, networks and storages.

Docker hub/registry

  • Docker registry manages and stores the docker images.
  • Two types of registry in docker
  • Public Registry: Public registry is also called as docker hub.
  • Private registry: It is used to share images within the enterprise.

Docker images

  • Docker images are the read only binary templates used to create docker containers.OR single file with all dependencies and configuration required to run a program.
  • Ways to create an Image:
  • Take image from docker hub
  • Create image from Dockerfile
  • Create image from existing docker containers

Docker Container

  • Container hold the entire packages that needed to run the application.OR in other words
    we can say that, the image is a template and the container is a copy of that template.
  • Container is like a virtual machine.
  • Images becomes container when they run on docker engine.

--

--