Docker 01: Understanding docker and it's architecture.

Docker 01: Understanding docker and it's architecture.

What is docker?

Docker is a tool that helps developers to package, build and run software applications as services in containers. Here containers are lightweight and standalone units that contain all the required dependencies to run a software application.

Docker containers are created by running docker images. Here docker image is a read-only template of a container that contains a set of instructions for creating a container.

Components of Docker:

  • Docker Client (CLI)

  • REST API

  • Docker Server (Daemon).

Docker CLI is a command line interface that we use to send commands to Docker Daemon.

REST API provides an interface between Docker CLI and Docker Daemon. Receives the commands from Docker CLI and sends it to Daemon, similarly receives the response from Daemon and sends it to the Docker CLI.

Docker Daemon or Docker server is responsible for creating and managing the objects such as images, containers, volumes, networks, etc. on a host machine. Daemon processes the commands received by communicating with the OS Kernel.

One of the major advantages of docker is portability, that is, solves platform dependency problems, build once and run anywhere.

Now we have got basic idea of what is docker, let's understand why it was invented or created. What are the problems, docker is going solve and help the software development industry? To answer these questions we should know the evaluation of docker.

The evaluation of Docker:

Previously software industry used "Virtualization" to help teams increase productivity, decrease downtime, and faster disaster recovery, and cost savings compared to on-premise physical machines.

But the disadvantages of "Virtualization" are that, consumes a lot of resources such as dedicated OS, and dedicated memory. Though VMs are cheaper compared to Physical machines, costlier, and have a high maintenance, high bootup time, complex portability and scalability compared to containers.

In "Virtualization", the machines share only hardware but not OS/OS Kernel. It is like separate machines on a host machine.

Containerization: Organizations are moving towards containerization because containers require fewer resources, are cheaper and lightweight, easily portable and scalable.

Unlike VMs, containers don't need separate/guest OS they not only utilize the host's hardware but also its OS kernel. Resource optimization is high because they do not need dedicated memory allocation (can be limited).

Since there is no guest OS bootup time is very less. Highly portable and scalable as they are simple images that can be shared easily with the intended users across the globe. So people started using tools like Docker Containers for application deployments.

The components of docker

The Dockerfile Dockerfile is a normal text file that contains step-by-step instructions that need to be performed to run an application.

The docker image Upon building the Dockerfile using the docker build command, the docker Image is created.

So the docker image is a package of, configurations, source code and dependencies. Upon running a docker command docker run an environment or container will be created to run a service or to deploy an application.

The docker container If we run the docker image, an instance/environment will be created that environment is called a docker container.

The docker-compose If we want to launch multiple containers simultaneously, we use docker-compose. It helps us to run different services in different docker containers to deploy an application on the host machine.

The deployment Now the team has an isolated environment in the form of a container, the team will point the deployment of the application to the container.

Based on the need the application servers or containers can be scaled-up or scaled down to handle the load on the application.

Thank you for reading. Keep learning. #brahmakothapalli #dockerwithbrahma

Did you find this article valuable?

Support QA Automation Enthusiast by becoming a sponsor. Any amount is appreciated!