What is Docker and Container? Details explanation with Image!
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
What is Docker?
It is the tool and platform which helps to manage the containers, developed in Golang.
What is Container?
It is copy of image or isolated runtime environment for App, which has its own Filesystem, PID, user, network on top of the OS
Benefit of Docker?
- Saves cost, time in spawn/setting up environment
- Provides the isolated environment with out creating guest OS with help of Docker engine
- Docker registry has more than 100K images readily available
- Improves the utilization of resources
- Interoperability around env is much simple (having same runtime from dev till prod machines)
Docker Architecture
Docker has client through user can interact with Docker server on top there is ContainerD which will communicate with OS kernal to perform the necessary commands
User –> Docker client –> Docker Deamon –> ContainerD –> Linux kernal
Container lifecycle
Containers can be spawned with required Docker image. Container Images are readily available in the various docker registries
- create –> run –> stop –> kill –> restart –> remove
How Docker Works
Docker provides the isolated runtime env with help of Docker engine and Container D
- Container creation
Docker look for the image which container requires locally, if not found pull from one of its available registry. Image is filesystem which consists of ROOT FS, User FS, APP FS which requires to run the application. While running the container copy of docker image will be instantiated for the each container run. ContainerD will facilitate the required resource from kernel and creates the PID, network, User, Root FS mount to the container.