Docker - Architecture
Before learning the Docker architecture, first, you should know about the Docker Daemon.
What is Docker daemon?
- Docker daemon runs on the
host operating system
. It is responsible for running containers to managedocker services
. It offers various Docker objects such asimages
,containers
,networking
, andstorage
.
Docker architecture
- Docker follows Client-Server architecture, which includes the three main components that are
Docker Client
,Docker Host
, andDocker Registry
.
1. Docker Client
- Docker client uses
commands
andREST APIs
to communicate with the Docker Daemon (Server). When a client runs any docker command on thedocker client terminal
, the client terminal sends these docker commands to the Docker daemon. Docker daemon receives these commands from thedocker client
in the form ofcommand
andREST API's request
.
2. Docker Host
- Docker Host is used to provide an environment to execute and run applications. It contains the
docker daemon
,images
,containers
,networks
, andstorage
.
3. Docker Registry
Docker Registry manages and stores the Docker images.
There are two types of
registries
in the Docker:- Public Registry - is also called as Docker hub.
- Private Registry - It is used to share
images
within the enterprise.
Docker Objects
- There are the following Docker Objects:
Docker Images
- Docker images are the
read-only binary templates
used to create Docker Containers.
Docker Containers
Containers are the structural units of Docker, which is used to hold the entire package that is needed to run the application. The
advantage of containers
is that it requires very less resources.In other words, we can say that the
image
is atemplate
, and thecontainer
is acopy of that template
.
Docker Networking
- Using Docker Networking, an isolated package can be communicated. Docker contains the following
network drivers
:- Bridge - It is a default
network driver
for thecontainer
. It is used whenmultiple docker
communicates with thesame docker host
. - Host - It is used when we don't need for
network isolation
between thecontainer
and thehost
. - None - It disables all the
networking
. - Overlay - It offers
Swarm services
to communicate with each other. It enablescontainers
to run on the differentdocker host
. - Macvlan - It is used when we want to assign
MAC addresses
to thecontainers
.
- Bridge - It is a default
Docker Storage
- Docker Storage is used to store data on the
container
. Docker offers the following options for theStorage
:- Data Volume - It provides the ability to create
persistence storage
. It also allows us toname volumes
,list volumes
, andcontainers associates with the volumes
. - Directory Mounts - It is one of the best options for
docker storage
. Itmounts
ahost's directory
into acontainer
. - Storage Plugins - It provides an ability to connect to
external storage platforms
.
- Data Volume - It provides the ability to create