Motivation
In early years of software development process regarding to deploy software on multiple machines you have to repeat deployment steps for every machine you have, Then the need of isolating applications with it’s own dependencies and libraries to be compatible with versions and reduce the overhead of repeating this work on multiple machines/servers came up.
One step ahead, Virtual Machine
VM is a guest Operating System can be run on top of another OS on same hardware and sharing physical components and resources of that machine by using a middle ware the helping in sharing resources operation.
Virtual Machine Pros & Cons
Pros
● Portable
● Less hardware cost
● Supports legacy operating systems
Cons
● Consuming resource
● Less performance
Another step ahead, Containers (Docker)
Docker is a software creates isolated containers that hold a software with it’s own libraries that can be run on any OS and can be transferred from machine to another through docker images.
Docker Components
Docker client
Docker client is responsible for taking the commands from user like (docker ps, docker images) and talk to docker server to execute the command.
Docker Server
Docker server also known as Docker daemon responsible for running the commands that come from docker client like listing the images, run container and so on..
Docker Host
Docker host is the host operating system for docker which docker uses to share it’s resources with containers.
Docker Image
A read-only and sharable set of files that are compiles to create one or more container.
Docker Container
Is a writable instance of image and each container has it’s own file system layer.
Docker Repository
It’s a repository of docker images you can deal with it as git repository review your images add tags to your updates and so on.
Docker Registry
A place responsible for providing docker images, that users can upload and download images like docker hub, thus you don't need to install any software from scratch and handle its' configuration, just pull the image and run the container.
Docker components interaction
Docker container holds a process
Each docker container has a process that starts when you execute docker run command, When this process is finished the container stopped and as much as process is running container will be working as well.
How Docker containers run among any OS?
First of all, any docker image is already built on top of Linux OS and that the common in docker world, so when the container runs on Linux system this OS will be docker host directly, Then the container can use up to 100% of machine resources.
On the other hand when we use Docker on top of Mac or Windows, there is software called Docker Desktop you have to install, this application installs internally a small version of Linux OS and this will be the Docker Host and also docker desktop allow you to manage how much resources can docker take for containers.
Long short story: You always run containers based on Linux OS
Note: there is a windows based images also but it’s not common to use.
IF YOU LIKED THE POST, THEN YOU CAN SUPPPORT SUCH CONTENT WITH A CUP OF COFFEE, THANKS IN ADVANCE.
Top comments (0)