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

Docker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesDocker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesSreenivas Makam
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to KubernetesImesh Gunaratne
 
Optimizing Docker Images
Optimizing Docker ImagesOptimizing Docker Images
Optimizing Docker ImagesBrian DeHamer
 
Introduction to Docker - 2017
Introduction to Docker - 2017Introduction to Docker - 2017
Introduction to Docker - 2017Docker, Inc.
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes IntroductionPeng Xiao
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersYajushi Srivastava
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetesDongwon Kim
 
Terraform: Infrastructure as Code
Terraform: Infrastructure as CodeTerraform: Infrastructure as Code
Terraform: Infrastructure as CodePradeep Bhadani
 
Why Docker
Why DockerWhy Docker
Why DockerdotCloud
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 
DevOps in AWS with Kubernetes
DevOps in AWS with KubernetesDevOps in AWS with Kubernetes
DevOps in AWS with KubernetesOleg Chunikhin
 
Kubernetes a comprehensive overview
Kubernetes   a comprehensive overviewKubernetes   a comprehensive overview
Kubernetes a comprehensive overviewGabriel Carro
 
Kubernetes introduction
Kubernetes introductionKubernetes introduction
Kubernetes introductionDongwon Kim
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansibleKhizer Naeem
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleKnoldus Inc.
 

What's hot (20)

Docker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesDocker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting Techniques
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
 
Optimizing Docker Images
Optimizing Docker ImagesOptimizing Docker Images
Optimizing Docker Images
 
Introduction to Docker - 2017
Introduction to Docker - 2017Introduction to Docker - 2017
Introduction to Docker - 2017
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
Jboss Tutorial Basics
Jboss Tutorial BasicsJboss Tutorial Basics
Jboss Tutorial Basics
 
Terraform: Infrastructure as Code
Terraform: Infrastructure as CodeTerraform: Infrastructure as Code
Terraform: Infrastructure as Code
 
Why Docker
Why DockerWhy Docker
Why Docker
 
YAML Magic
YAML MagicYAML Magic
YAML Magic
 
Introduce to Terraform
Introduce to TerraformIntroduce to Terraform
Introduce to Terraform
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Docker internals
Docker internalsDocker internals
Docker internals
 
DevOps in AWS with Kubernetes
DevOps in AWS with KubernetesDevOps in AWS with Kubernetes
DevOps in AWS with Kubernetes
 
Kubernetes a comprehensive overview
Kubernetes   a comprehensive overviewKubernetes   a comprehensive overview
Kubernetes a comprehensive overview
 
Docker on Docker
Docker on DockerDocker on Docker
Docker on Docker
 
Kubernetes introduction
Kubernetes introductionKubernetes introduction
Kubernetes introduction
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 

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
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with DockerRavindu Fernando
 
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.
 

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
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
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
 

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

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 

Recently uploaded (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 

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