What is Docker and Container? Details explaination with Image!

  • What is Docker?

Docker is a tool or platform to simultaneously run multiple applications or multiple instances of same application in a loosely isolated environment.

  • What is Container?

It’s a virtual machine which can be configured to run with single mount, NET, PID Map, User in isolated environment. Allocated with separate BOOT FILESYSTEMS + ROOT FILESYSTEMS + USER FILESYSTEMS + APP FILESYSTEMS which enables users to run applications/services independent of other containers while utilizing same resources.

  • Benefit of Docker?

Better utilization of resources, ability to run isolated services, saves time

  • Docker Architecture

Basically consists of:

Docker images – A template which specifies the root , app and user filesystems – to create a docker container with own application on top of root filesystem

Docker containers – It’s a virtual machine which can be configured to run with single mount, NET, PID Map, User in isolated environment. Allocated with separate BOOT FILESYSTEMS + ROOT FILESYSTEMS + USER FILESYSTEMS + APP FILESYSTEMS which enables users to run applications/services independent of other containers while utilizing same resources. Another words, runnable instance of docker image

Docker Client – which takes the docker commands from user and executes them.

Docker registry – A repository containing multiple docker images or root file systems which be used for creating a custom docker image as base image

Docker daemon/ dockerd – which listens to instructions/ docker APIs from docker client and manages objects based on that. Creation of container, managing resources etc.

  • Container lifecycle

create -> start -> stop -> start -> restart -> pause -> unpause -> kill -> remove

  • How Docker Works!!

When request for creation of new docker container with a custom docker image is received, the tool allocates resources based on the template/image provided on top of boot filesystem/kernel in form of containers/VMs while managing isolation of one container from other and runs the custom app filesystem (the user application) on top of the allocated resources. Hence being able to run multiple such applications.