SlideShare a Scribd company logo
1 of 26
Docker 
Architecture 
based 
on 
v 
1.3 
Compiled 
by 
Rajdeep 
Dua 
Twi?er 
: 
@rajdeepdua 
Oct 
2014 
Tuesday, November 4, 14
Before 
we 
get 
started 
• What 
is 
a 
Container? 
– Group 
of 
processes 
contained 
in 
a 
Isolated 
Environment 
– IsolaNon 
provided 
by 
Concepts 
like 
cgroups 
and 
namespaces 
• What 
is 
Docker? 
– ImplementaNon 
of 
a 
container 
which 
is 
portable 
using 
a 
concept 
of 
image. 
Tuesday, November 4, 14
CGroup 
• Limit, 
account, 
and 
isolate 
resource 
usage 
(CPU, 
memory, 
disk 
I/O, 
etc.) 
of 
process 
groups. 
• Resource 
limi@ng: 
groups 
can 
be 
set 
to 
not 
exceed 
a 
set 
memory 
limit 
— 
this 
also 
includes 
file 
system 
cache. 
• Priori@za@on: 
some 
groups 
may 
get 
a 
larger 
share 
of 
CPU[8] 
or 
disk 
I/O 
throughput. 
• Accoun@ng: 
to 
measure 
how 
much 
resources 
certain 
systems 
use 
• Control: 
freezing 
groups 
or 
checkpoin@ng 
and 
restar@ng. 
Tuesday, November 4, 14
Namespace 
• ParNNon 
essenNal 
kernel 
structures 
to 
create 
virtual 
environments 
• Different 
Namespaces 
– pid 
(processes) 
– net 
(network 
interfaces, 
rouNng...) 
– ipc 
(System 
V 
IPC) 
– mnt 
(mount 
points, 
filesystems) 
– uts 
(hostname) 
– user 
(UIDs) 
Tuesday, November 4, 14
Docker 
• Manages 
Images 
and 
Container 
runNmes 
• Supports 
mulNple 
file 
system 
back-­‐ends 
• MulNple 
Execdrivers 
for 
container 
implementaNon 
• Client 
and 
server 
components 
– 
interacNon 
using 
HTTP 
using 
unix 
sockets 
Tuesday, November 4, 14
Docker 
RunNme 
Components 
Tuesday, November 4, 14
Docker 
Engine 
• Core 
of 
Docker 
: 
Store 
for 
Containers 
• Manages 
containers 
using 
Jobs 
(similar 
to 
Unix 
jobs) 
• Contains 
Handlers 
a 
funcNon 
which 
wraps 
Jobs 
• All 
the 
acNons 
performed 
using 
Jobs 
Engine 
n 1 1 
1 Handler Job 
Tuesday, November 4, 14
Docker 
IniNalizaNon 
1. Main 
funcNon 
of 
Docker 
: 
docker.main() 
2. Calls 
: 
mainDaemon() 
3. InstanNate 
Engine 
eng := engine.New() 
4. 
Register 
built-­‐ins 
builtsin.Register(eng) 
5. 
InstanNate 
job 
job := eng.Job(“initserver”) 
6. 
Set 
Env 
variables 
for 
the 
Job 
Tuesday, November 4, 14
Docker 
IniNalizaNon 
5. Run 
the 
Job 
job.run() 
6. Start 
AccepNng 
ConnecNons 
eng.Job(“AcceptConnections”).run() 
Tuesday, November 4, 14
Docker 
IniNalizaNon 
: 
4 
4. 
Register 
built-­‐ins 
Instantiate daemon(eng) 
//see later slides for details 
eng.Register("initserver", server.InitServer) 
//see later slides for details 
eng.Register(“init_networkdriver”, bridge.InitDriver) 
Tuesday, November 4, 14
Daemon 
• Main 
Entry 
point 
for 
all 
the 
requests 
to 
manage 
containers 
• Data 
Structure 
which 
maintains 
following 
references 
– ImageGraph 
– Volume 
Graph 
– Engine 
– ExecDriver 
– Server 
– ContainerStore 
Tuesday, November 4, 14
Daemon 
-­‐ 
Graph 
• Graph 
is 
a 
(structure) 
store 
of 
versioned 
file 
system 
and 
rela@onship 
between 
images 
• For 
each 
container 
a 
Graph 
is 
instan@ated 
• References 
a 
graphdriver.Driver 
• Ac@ons 
on 
a 
Graph 
– Create 
a 
New 
Graph 
– Get 
image 
from 
a 
Graph 
– Restores 
a 
Graph 
– Creates 
an 
Image 
and 
Register 
in 
the 
Graph 
– Registers 
a 
pre-­‐exis@ng 
image 
on 
the 
Graph 
Tuesday, November 4, 14
Concept 
of 
Images 
and 
Containers 
in 
Docker 
• Docker 
image 
is 
a 
Layer 
in 
the 
file 
System 
• Containers 
are 
two 
Layers 
– Layer 
one 
is 
init 
layer 
based 
on 
Image 
– Layer 
two 
is 
the 
actual 
container 
content 
Container 
Content 
Image 
Content 
Layer 
Init 
Layer 
Docker 
Container 
Tuesday, November 4, 14
Container 
in 
Docker 
• DataStructure 
which 
resides 
in-­‐memory 
and 
is 
persisted 
in 
SQLite 
store 
• References 
other 
components 
like 
– Daemon 
– Volumes 
– Has 
a 
lifecycle 
which 
is 
controlled 
by 
Daemon 
– Daemon 
has 
in-­‐memory 
dicNonary 
of 
containerIDs 
and 
containers 
14 
Tuesday, November 4, 14
Lifecycle 
of 
a 
Container 
15 
Tuesday, November 4, 14
Graph 
Driver 
• Referenced 
by 
the 
Daemon 
• Used 
to 
abstract 
mulNple 
storage 
backends 
• Loads 
one 
of 
the 
following 
File 
System 
Backends 
– aufs 
– Device 
mapper 
(devmapper) 
– vfs 
– btrfs 
Tuesday, November 4, 14
Container 
store 
• Persistent 
backend 
for 
Container 
data 
• Implemented 
using 
SQLite 
• Referenced 
from 
Daemon 
containerGraph: graph 
Used 
to 
load 
container 
informaNon 
during 
Daemon 
restore 
Tuesday, November 4, 14
Volume 
Graph 
• Simple 
vfs 
based 
Graph 
to 
keep 
track 
of 
container 
volumes 
• Volumes 
used 
volume 
driver 
in 
Daemon 
to 
create 
and 
a?ach 
volumes 
to 
the 
container 
• Each 
container 
is 
associated 
with 
one 
of 
more 
volumes 
Tuesday, November 4, 14
ExecDriver 
• AbstracNon 
for 
the 
underlying 
Linux 
Containment 
• Called 
from 
the 
daemon 
• Supports 
following 
implementaNon 
– LXC 
– NaNve 
Tuesday, November 4, 14
Driver 
Interfaces 
• Abstract 
Interface 
to 
interact 
with 
the 
underlying 
implementaNon. 
type driver Interface{ 
Run(c *Command,..) 
Kill(c *Command) 
Pause(c *Command) 
Name() 
GetProcessIdsForContainer(id string) 
Terminate() 
} 
Tuesday, November 4, 14
Driver 
Interfaces 
-­‐ 
Networking 
• Abstract 
Interface 
to 
interact 
with 
the 
underlying 
implementaNon. 
type Network struct { 
Interface *NetworkInterface 
Mtu int 
ContainerID string 
HostNetworking bool 
} 
Tuesday, November 4, 14
libcontainer 
• Underlying 
naNve 
implementaNon 
of 
the 
Container 
• Used 
by 
the 
naNve 
driver 
• Container.config 
– 
representaNon 
of 
a 
container 
data 
• Wrapper 
over 
cgroups 
and 
Namespaces 
Tuesday, November 4, 14
NaNve 
Driver 
ImplementaNon 
Tuesday, November 4, 14
Steps 
in 
Container 
CreaNon 
Container 
Create 
Tuesday, November 4, 14
Container 
Commit 
Tuesday, November 4, 14
Summary 
• Linux 
Containment 
Principles 
• Docker 
Architectural 
components 
• NaNve 
Driver 
ImplementaNon 
– 
libcontainer 
• ContainerCreaNon 
Tuesday, November 4, 14

More Related Content

What's hot

Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker ComposeAjeet Singh Raina
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerAditya Konarde
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with DockerRavindu Fernando
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefitsAmit Manwade
 
Introduction to Docker - 2017
Introduction to Docker - 2017Introduction to Docker - 2017
Introduction to Docker - 2017Docker, Inc.
 
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...Simplilearn
 
Kubernetes vs Docker Swarm | Container Orchestration War | Kubernetes Trainin...
Kubernetes vs Docker Swarm | Container Orchestration War | Kubernetes Trainin...Kubernetes vs Docker Swarm | Container Orchestration War | Kubernetes Trainin...
Kubernetes vs Docker Swarm | Container Orchestration War | Kubernetes Trainin...Edureka!
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basicsSourabh Saxena
 
Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker, Inc.
 
Kubernetes
KubernetesKubernetes
Kuberneteserialc_w
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker, Inc.
 
Kubernetes - introduction
Kubernetes - introductionKubernetes - introduction
Kubernetes - introductionSparkbit
 

What's hot (20)

Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker Compose
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
What is Docker
What is DockerWhat is Docker
What is Docker
 
Helm 3
Helm 3Helm 3
Helm 3
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefits
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
 
Introduction to Docker - 2017
Introduction to Docker - 2017Introduction to Docker - 2017
Introduction to Docker - 2017
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Kubernetes vs Docker Swarm | Container Orchestration War | Kubernetes Trainin...
Kubernetes vs Docker Swarm | Container Orchestration War | Kubernetes Trainin...Kubernetes vs Docker Swarm | Container Orchestration War | Kubernetes Trainin...
Kubernetes vs Docker Swarm | Container Orchestration War | Kubernetes Trainin...
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basics
 
Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016
 
Kubernetes - introduction
Kubernetes - introductionKubernetes - introduction
Kubernetes - introduction
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 

Similar to Docker Architecture (v1.3)

Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...Lucas Jellema
 
Using Docker with OpenStack - Hands On!
 Using Docker with OpenStack - Hands On! Using Docker with OpenStack - Hands On!
Using Docker with OpenStack - Hands On!Adrian Otto
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with DockerGeeta Vinnakota
 
Drupal 8 + Elasticsearch + Docker
Drupal 8 + Elasticsearch + DockerDrupal 8 + Elasticsearch + Docker
Drupal 8 + Elasticsearch + DockerRoald Umandal
 
Tech talk on docker with demo
Tech talk on docker with demoTech talk on docker with demo
Tech talk on docker with demoSandeep Karnawat
 
Continuous Integration with Docker on AWS
Continuous Integration with Docker on AWSContinuous Integration with Docker on AWS
Continuous Integration with Docker on AWSAndrew Heifetz
 
Postgre sql linuxcontainers by Jignesh Shah
Postgre sql linuxcontainers by Jignesh ShahPostgre sql linuxcontainers by Jignesh Shah
Postgre sql linuxcontainers by Jignesh ShahPivotalOpenSourceHub
 
VASCAN - Docker and Security
VASCAN - Docker and SecurityVASCAN - Docker and Security
VASCAN - Docker and SecurityMichael Irwin
 
PostgreSQL and Linux Containers
PostgreSQL and Linux ContainersPostgreSQL and Linux Containers
PostgreSQL and Linux ContainersJignesh Shah
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 applicationRoman Rodomansky
 
Introduction to automated environment management with Docker Containers - for...
Introduction to automated environment management with Docker Containers - for...Introduction to automated environment management with Docker Containers - for...
Introduction to automated environment management with Docker Containers - for...Lucas Jellema
 
Ansible Oxford - Cows & Containers
Ansible Oxford - Cows & ContainersAnsible Oxford - Cows & Containers
Ansible Oxford - Cows & Containersjonatanblue
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerHiroki Endo
 
virtualization-vs-containerization-paas
virtualization-vs-containerization-paasvirtualization-vs-containerization-paas
virtualization-vs-containerization-paasrajdeep
 
Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1Docker, Inc.
 
Docker presentation | Paris Docker Meetup
Docker presentation | Paris Docker MeetupDocker presentation | Paris Docker Meetup
Docker presentation | Paris Docker MeetupdotCloud
 

Similar to Docker Architecture (v1.3) (20)

Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
 
Java developer intro to environment management with vagrant puppet and docker
Java developer intro to environment management with vagrant puppet and dockerJava developer intro to environment management with vagrant puppet and docker
Java developer intro to environment management with vagrant puppet and docker
 
Using Docker with OpenStack - Hands On!
 Using Docker with OpenStack - Hands On! Using Docker with OpenStack - Hands On!
Using Docker with OpenStack - Hands On!
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
Docker in OpenStack
Docker in OpenStackDocker in OpenStack
Docker in OpenStack
 
141204 upload
141204 upload141204 upload
141204 upload
 
Drupal 8 + Elasticsearch + Docker
Drupal 8 + Elasticsearch + DockerDrupal 8 + Elasticsearch + Docker
Drupal 8 + Elasticsearch + Docker
 
Tech talk on docker with demo
Tech talk on docker with demoTech talk on docker with demo
Tech talk on docker with demo
 
Continuous Integration with Docker on AWS
Continuous Integration with Docker on AWSContinuous Integration with Docker on AWS
Continuous Integration with Docker on AWS
 
Postgre sql linuxcontainers by Jignesh Shah
Postgre sql linuxcontainers by Jignesh ShahPostgre sql linuxcontainers by Jignesh Shah
Postgre sql linuxcontainers by Jignesh Shah
 
VASCAN - Docker and Security
VASCAN - Docker and SecurityVASCAN - Docker and Security
VASCAN - Docker and Security
 
PostgreSQL and Linux Containers
PostgreSQL and Linux ContainersPostgreSQL and Linux Containers
PostgreSQL and Linux Containers
 
Docker Dojo
Docker DojoDocker Dojo
Docker Dojo
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Introduction to automated environment management with Docker Containers - for...
Introduction to automated environment management with Docker Containers - for...Introduction to automated environment management with Docker Containers - for...
Introduction to automated environment management with Docker Containers - for...
 
Ansible Oxford - Cows & Containers
Ansible Oxford - Cows & ContainersAnsible Oxford - Cows & Containers
Ansible Oxford - Cows & Containers
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
virtualization-vs-containerization-paas
virtualization-vs-containerization-paasvirtualization-vs-containerization-paas
virtualization-vs-containerization-paas
 
Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1
 
Docker presentation | Paris Docker Meetup
Docker presentation | Paris Docker MeetupDocker presentation | Paris Docker Meetup
Docker presentation | Paris Docker Meetup
 

More from rajdeep

Aura Framework Overview
Aura Framework OverviewAura Framework Overview
Aura Framework Overviewrajdeep
 
Docker 1.5
Docker 1.5Docker 1.5
Docker 1.5rajdeep
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introductionrajdeep
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetesrajdeep
 
Openstack Overview
Openstack OverviewOpenstack Overview
Openstack Overviewrajdeep
 
VMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - OverviewVMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - Overviewrajdeep
 
Cloudfoundry Overview
Cloudfoundry OverviewCloudfoundry Overview
Cloudfoundry Overviewrajdeep
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Diverajdeep
 
Openstack meetup-pune-aug22-overview
Openstack meetup-pune-aug22-overviewOpenstack meetup-pune-aug22-overview
Openstack meetup-pune-aug22-overviewrajdeep
 
Deploy Cloud Foundry using bosh_bootstrap
Deploy Cloud Foundry using bosh_bootstrapDeploy Cloud Foundry using bosh_bootstrap
Deploy Cloud Foundry using bosh_bootstraprajdeep
 
Managing Activity Backstack
Managing Activity BackstackManaging Activity Backstack
Managing Activity Backstackrajdeep
 
Cloud Foundry Architecture and Overview
Cloud Foundry Architecture and OverviewCloud Foundry Architecture and Overview
Cloud Foundry Architecture and Overviewrajdeep
 
Cloud Foundry Open Tour India 2012 , Keynote
Cloud Foundry Open Tour India 2012 , KeynoteCloud Foundry Open Tour India 2012 , Keynote
Cloud Foundry Open Tour India 2012 , Keynoterajdeep
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundryrajdeep
 
Google cloud platform
Google cloud platformGoogle cloud platform
Google cloud platformrajdeep
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Enginerajdeep
 

More from rajdeep (16)

Aura Framework Overview
Aura Framework OverviewAura Framework Overview
Aura Framework Overview
 
Docker 1.5
Docker 1.5Docker 1.5
Docker 1.5
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introduction
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Openstack Overview
Openstack OverviewOpenstack Overview
Openstack Overview
 
VMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - OverviewVMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - Overview
 
Cloudfoundry Overview
Cloudfoundry OverviewCloudfoundry Overview
Cloudfoundry Overview
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Dive
 
Openstack meetup-pune-aug22-overview
Openstack meetup-pune-aug22-overviewOpenstack meetup-pune-aug22-overview
Openstack meetup-pune-aug22-overview
 
Deploy Cloud Foundry using bosh_bootstrap
Deploy Cloud Foundry using bosh_bootstrapDeploy Cloud Foundry using bosh_bootstrap
Deploy Cloud Foundry using bosh_bootstrap
 
Managing Activity Backstack
Managing Activity BackstackManaging Activity Backstack
Managing Activity Backstack
 
Cloud Foundry Architecture and Overview
Cloud Foundry Architecture and OverviewCloud Foundry Architecture and Overview
Cloud Foundry Architecture and Overview
 
Cloud Foundry Open Tour India 2012 , Keynote
Cloud Foundry Open Tour India 2012 , KeynoteCloud Foundry Open Tour India 2012 , Keynote
Cloud Foundry Open Tour India 2012 , Keynote
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
 
Google cloud platform
Google cloud platformGoogle cloud platform
Google cloud platform
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Docker Architecture (v1.3)

  • 1. Docker Architecture based on v 1.3 Compiled by Rajdeep Dua Twi?er : @rajdeepdua Oct 2014 Tuesday, November 4, 14
  • 2. Before we get started • What is a Container? – Group of processes contained in a Isolated Environment – IsolaNon provided by Concepts like cgroups and namespaces • What is Docker? – ImplementaNon of a container which is portable using a concept of image. Tuesday, November 4, 14
  • 3. CGroup • Limit, account, and isolate resource usage (CPU, memory, disk I/O, etc.) of process groups. • Resource limi@ng: groups can be set to not exceed a set memory limit — this also includes file system cache. • Priori@za@on: some groups may get a larger share of CPU[8] or disk I/O throughput. • Accoun@ng: to measure how much resources certain systems use • Control: freezing groups or checkpoin@ng and restar@ng. Tuesday, November 4, 14
  • 4. Namespace • ParNNon essenNal kernel structures to create virtual environments • Different Namespaces – pid (processes) – net (network interfaces, rouNng...) – ipc (System V IPC) – mnt (mount points, filesystems) – uts (hostname) – user (UIDs) Tuesday, November 4, 14
  • 5. Docker • Manages Images and Container runNmes • Supports mulNple file system back-­‐ends • MulNple Execdrivers for container implementaNon • Client and server components – interacNon using HTTP using unix sockets Tuesday, November 4, 14
  • 6. Docker RunNme Components Tuesday, November 4, 14
  • 7. Docker Engine • Core of Docker : Store for Containers • Manages containers using Jobs (similar to Unix jobs) • Contains Handlers a funcNon which wraps Jobs • All the acNons performed using Jobs Engine n 1 1 1 Handler Job Tuesday, November 4, 14
  • 8. Docker IniNalizaNon 1. Main funcNon of Docker : docker.main() 2. Calls : mainDaemon() 3. InstanNate Engine eng := engine.New() 4. Register built-­‐ins builtsin.Register(eng) 5. InstanNate job job := eng.Job(“initserver”) 6. Set Env variables for the Job Tuesday, November 4, 14
  • 9. Docker IniNalizaNon 5. Run the Job job.run() 6. Start AccepNng ConnecNons eng.Job(“AcceptConnections”).run() Tuesday, November 4, 14
  • 10. Docker IniNalizaNon : 4 4. Register built-­‐ins Instantiate daemon(eng) //see later slides for details eng.Register("initserver", server.InitServer) //see later slides for details eng.Register(“init_networkdriver”, bridge.InitDriver) Tuesday, November 4, 14
  • 11. Daemon • Main Entry point for all the requests to manage containers • Data Structure which maintains following references – ImageGraph – Volume Graph – Engine – ExecDriver – Server – ContainerStore Tuesday, November 4, 14
  • 12. Daemon -­‐ Graph • Graph is a (structure) store of versioned file system and rela@onship between images • For each container a Graph is instan@ated • References a graphdriver.Driver • Ac@ons on a Graph – Create a New Graph – Get image from a Graph – Restores a Graph – Creates an Image and Register in the Graph – Registers a pre-­‐exis@ng image on the Graph Tuesday, November 4, 14
  • 13. Concept of Images and Containers in Docker • Docker image is a Layer in the file System • Containers are two Layers – Layer one is init layer based on Image – Layer two is the actual container content Container Content Image Content Layer Init Layer Docker Container Tuesday, November 4, 14
  • 14. Container in Docker • DataStructure which resides in-­‐memory and is persisted in SQLite store • References other components like – Daemon – Volumes – Has a lifecycle which is controlled by Daemon – Daemon has in-­‐memory dicNonary of containerIDs and containers 14 Tuesday, November 4, 14
  • 15. Lifecycle of a Container 15 Tuesday, November 4, 14
  • 16. Graph Driver • Referenced by the Daemon • Used to abstract mulNple storage backends • Loads one of the following File System Backends – aufs – Device mapper (devmapper) – vfs – btrfs Tuesday, November 4, 14
  • 17. Container store • Persistent backend for Container data • Implemented using SQLite • Referenced from Daemon containerGraph: graph Used to load container informaNon during Daemon restore Tuesday, November 4, 14
  • 18. Volume Graph • Simple vfs based Graph to keep track of container volumes • Volumes used volume driver in Daemon to create and a?ach volumes to the container • Each container is associated with one of more volumes Tuesday, November 4, 14
  • 19. ExecDriver • AbstracNon for the underlying Linux Containment • Called from the daemon • Supports following implementaNon – LXC – NaNve Tuesday, November 4, 14
  • 20. Driver Interfaces • Abstract Interface to interact with the underlying implementaNon. type driver Interface{ Run(c *Command,..) Kill(c *Command) Pause(c *Command) Name() GetProcessIdsForContainer(id string) Terminate() } Tuesday, November 4, 14
  • 21. Driver Interfaces -­‐ Networking • Abstract Interface to interact with the underlying implementaNon. type Network struct { Interface *NetworkInterface Mtu int ContainerID string HostNetworking bool } Tuesday, November 4, 14
  • 22. libcontainer • Underlying naNve implementaNon of the Container • Used by the naNve driver • Container.config – representaNon of a container data • Wrapper over cgroups and Namespaces Tuesday, November 4, 14
  • 23. NaNve Driver ImplementaNon Tuesday, November 4, 14
  • 24. Steps in Container CreaNon Container Create Tuesday, November 4, 14
  • 25. Container Commit Tuesday, November 4, 14
  • 26. Summary • Linux Containment Principles • Docker Architectural components • NaNve Driver ImplementaNon – libcontainer • ContainerCreaNon Tuesday, November 4, 14