Hello my dear readers , Greetings & welcome back!
Understanding Docker (Continued...)
Docker is an open source for building environment for applications to package with their relevant dependencies and to run independently regardless of the environment (Operating system).
It is written in GO programming language which uses several feature of linux kernal to use various features. Docker uses a technology called namespaces to provide the isolated workspace called the container.
Docker uses containerization technology to run application without OS installation in that container. It packages only applications and application dependencies in a container to run on top of any OS without pre-configuration of Hardware like CPU and Memory unlike in VMs we usually do.
What is a container?
A container is a runnable instance of an Application derived/deployed from an image stored in image repository. You can move, build or rebuild, modify or delete a container or application inside the container.
Containers are actually light weight application instances which run on top of OS and actually share same OS for hardware utilization required by applications.
What is Container Host?
So, a container is a loosely coupled workload isolated from an other Application running on the same Operating system and that operating system whether installed in side a VM or on a physical computer system is known as container host. In the case of Docker, This is known as Docker Host as shown in the figure below
What is Image repository?
An image repository is actually a place for storing different applications templates we can use to deploy in a container with deployment instructions. In the case of Docker, this repository is known as Docker Registry.
Mostly, an image is based on some other customizations which may require to run application on some specific environment requirements. For example, an image may be built on top of Ubuntu OS with Apache web server and an application running on top of that web server be installed with some dependencies which may require to be deployed along with application in a container.
These settings for applications to be deployed in a container are written in a declarative language to instruct Docker to deploy application. This declarative statements are normally written in a language which could be YAML or JSON.
Docker Architecture High-level
Basically, it is divided into three parts
- Client (Docker)
- Docker-Host (dockerd / Docker Daemon)
- Docker-Registry
1. Client (Docker)
when any user or administrator tries to connect to docker host it always uses docker client to communicate with container which is running in a docker host. In this way, a client process talks to docker host (dockerd) through which it communicates with container / application running inside the container. The client uses docker API to communicate with dockerd for container management. Example, docker run which communicates with docker host to initiate docker management environment.
2. What is Dockerd (Docker Host)?
The docker daemon (i.e. dockerd) recieves commands from client and runs or manages containers, images / image repositories, networks and volumes. A docker daemon can communicate with other daemons to manage services.
3. Docker Registry?
It stores docker images for applications to build / deploy in a container. Example is docker hub is a public docker image registry. Anyone can use this public repository and docker by default is going to look into this registry for images but you can have your private or own image registries as well.
When docker pull or docker run is being used then container images from repository are being utilized to be used as source of application delivery.
What is docker image?
Docker image is actually a read only template (of applications for Specific or generic OS based environments) you prepare to push in the repository for later use and deployment of applications in a container.
Usually, an image is based on another image, with some additional customization. For example, you may build an image which is based on the Ubuntu OS etc. To build your own image, you create a Dockerfile with a simple syntax for defining the steps needed to create the image and run it.
Below is the complete high level picture for understanding docker containerization using basic docker architecture what explained above.
Stay tuned ...๐
Coming up next "Installing Docker"
Go back to the previous topic
Contributors: