SlideShare a Scribd company logo
Containerization
By Imesha Sudasingha
Virtualization
Virtualization allows
distributed computing
models without creating
dependencies on physical
resources
Types of
Virtualization
● Native/Full
virtualization
● Hardware assisted
virtualization
● Para-virtualization
● Containerization (OS
level virtualization)
Containerization vs Virtual Machines
Virtualization interest over past 5 years
Source: Google Trends
Containerization interest over past 5 years
Source: Google Trends
Docker interest over past 5 years
Source: Google Trends
Containers vs VMs
Containers vs VMs - Virtualization
● Containers virtualize at the operating
system level.
○ Runs on Docker daemon
● Effectively virtualize the operating system.
● Make available protected portions of
operating system.
○ Two containers running on the same
operating system don't know that they are
sharing resources because each has its own
abstracted networking layer, processes and
so on.
● Use a layer on top of hardware
(hypervisor) to make pieces of hardware
available for virtual machines to install host
OS.
● Hypervisor-based solutions virtualize at the
hardware level.
○ “Type 1” (ex: Xen, VMWare ESX) on bare
metal hardware
○ “Type 2” (ex: VMWare/VirtualBox open
source versions) on the guest OS
Containers vs VMs - OS’s and Resources
● Containers run on an already running
operating system as the host environment.
○ Executes in spaces that are isolated from
each other and from certain parts of the
host OS.
● Much efficient resource utilization
○ If a container is not executing anything, no
resource is used.
○ Containers can call upon their host OS to
satisfy some or all of their dependencies.
● Containers are cheap and therefore fast to
create and destroy.
○ Just the cost of creating/stopping processes
that run in the isolated space.
○ Similar to starting/stopping a program in
our computer.
● Hypervisors only provide access to
hardware. We need to install the guest OS
by ourselves.
● When an OS per VM is running on the
same server, they eats up server resources
(CPU, RAM and bandwidth).
○ Inefficient resource utilization because
multiple guest OS’s eating up resources
(CPU time, etc) unnecessarily.
● Creation and destruction of a VM mean
booting up/shutting down an entire OS.
Interesting Stats
Why Docker?
● Docker tries to solve the
problem of “dependency hell”
● Imagine being able to package
an application along with all of
its dependencies easily and then
run it smoothly in disparate
development, test and
production environments
Dependency Hell
What is Docker?
Under the hood
● Processes executing in a Docker container are isolated from processes running
on the host OS or in other Docker containers.
○ Nevertheless, all processes are executing in the same kernel
○ Containers sandbox processes from each other
● Docker uses 3 concepts to achieve this OS level virtualization.
○ LXC(Linux Containers)
■ Namespaces - To provide namespaces for containers
■ cgroups (Control Groups) - For resource auditing and limiting
○ copy-on-write filesystem - AuFS (Advanced Multi-Layered Unification Filesystem)
LXC Namespaces
LXC Namespaces
● A user-space control package for Linux Containers.
○ Limits what you can see (and therefore use).
● Uses namespaces for isolation at different levels.
○ Uses kernel-level namespaces to isolate the container from the host.
○ User namespace separates the container's and the host's user database, thus ensuring that the
container's root user does not have root privileges on the host.
○ The process namespace is responsible for displaying and managing only processes running in the
container, not the host.
○ the network namespace provides the container with its own network device and virtual IP
address.
LXC Namespaces contd ...
● Provide processes with their own view of the system
● Multiple namespaces:
○ pid
○ net
○ mnt
○ uts
○ ipc
○ user
● Each process is in one namespace of each type
PID Namespaces
● Processes within a PID namespace only see processes in the same PID
namespace.
● Each PID namespace has its own numbering.
○ Starting at 1
○ When PID 1 goes away, the whole namespace is killed.
● Those namespaces can be nested.
● A process ends up having multiple PIDs
○ One per namespace in which its nested
Net Namespaces
● Processes within a given network namespace get their own private network
stack, including:
○ network interfaces (including lo)
○ routing tables
○ iptables rules
○ sockets (ss, netstat)
● You can move a network interface from a netns to another
○ ip link set dev eth0 netns PID
Mnt Namespaces
● Processes can have their own root fs (chroot)
● Processes can also have "private" mounts
○ /tmp (scoped per user, per service...)
○ Masking of /proc, /sys
○ NFS automounts
● Mounts can be totally private, or shared
IPC Namespaces
● Allows a process (or group of processes) to have own:
○ IPC semaphores
○ IPC message queues
○ IPC shared memory
● without risk of conflict with other instances
User Namespaces
● Allows to map UID/GID; e.g.:
○ UID 0→1999 in container C1 is mapped to
○ UID 10000→11999 on host
○ UID 0→1999 in container C2 is mapped to
○ UID 12000→13999 on host
○ etc.
● Avoids extra configuration in containers
● UID 0 (root) can be squashed to a non-privileged user
● Security improvement
LXC cgroups
LXC cgroups
● Older than namespaces concept.
● Resource metering and limiting
○ Memory
○ CPU
○ block I/O
○ network
● Device node (/dev/*) access control
● While allowing Docker to limit the resources being consumed by a container
also output lots of metrics about these resources.
○ Allow Docker to monitor the resource consumption of the various processes within the
containers and make sure that each gets only its fair share of the available resources.
Copy-on-write file
system
Copy-on-write filesystem
● Create a new container instantly
○ Instead of copying its whole filesystem
○ Allows Docker to use certain images as the basis for containers
● Storage keeps track of what has changed
● Many options available
○ AuFS (Advanced Multi-Layered Unification Filesystem), overlay (file level)
○ BTRFS, VFS
○ Device-Mapper
● Considerably reduces footprint and "boot" times
Performance
“Docker equals or exceeds
KVM performance in
every case we tested”
Containers inside VMs ...
Future of
Containerization
Areas of Evolution
● Kubernetes
● Serverless (FaaS)
○ AWS Lambda
○ Google Cloud Functions
○ Azure Functions
○ IBM OpenWhisk
● Microservices
Kubernetes - Popularity
Serverless - Popularity
Thank you!
References
● Docker: lightweight linux containers for consistent development and
deployment [2014]
● An updated performance comparison of virtual machines and Linux containers
[2015]
● https://www.slideshare.net/jpetazzo/anatomy-of-a-container-namespaces-
cgroups-some-filesystem-magic-linuxcon
● https://www.slideshare.net/Docker/golubbenarevmspasse-
140402122017phpapp02-37589021
● https://www.slideshare.net/julienbarbier42/docker-the-future-of-distributed-
applications-docker-tour-de-france-2014

More Related Content

What's hot

Introduction to Containers and Docker
Introduction to Containers and DockerIntroduction to Containers and Docker
Introduction to Containers and Docker
Fayçal Bziou
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
DuckDuckGo
 
Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and image
ejlp12
 
Containerization and Docker
Containerization and DockerContainerization and Docker
Containerization and Docker
Megha Bansal
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016
Docker, Inc.
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Instruqt
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
dotCloud
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0
Docker, Inc.
 
Introduction to Docker Containers - Docker Captain
Introduction to Docker Containers - Docker CaptainIntroduction to Docker Containers - Docker Captain
Introduction to Docker Containers - Docker Captain
Ajeet Singh Raina
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
Raffaele Di Fazio
 
Dockers and kubernetes
Dockers and kubernetesDockers and kubernetes
Dockers and kubernetes
Dr Ganesh Iyer
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefits
Amit Manwade
 
Docker Containers Deep Dive
Docker Containers Deep DiveDocker Containers Deep Dive
Docker Containers Deep Dive
Will Kinard
 
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Edureka!
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Peng Xiao
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
Martin Danielsson
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
Gourav Varma
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
Balint Pato
 
Kubernetes PPT.pptx
Kubernetes PPT.pptxKubernetes PPT.pptx
Kubernetes PPT.pptx
ssuser0cc9131
 
Why Docker
Why DockerWhy Docker
Why Docker
dotCloud
 

What's hot (20)

Introduction to Containers and Docker
Introduction to Containers and DockerIntroduction to Containers and Docker
Introduction to Containers and Docker
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and image
 
Containerization and Docker
Containerization and DockerContainerization and Docker
Containerization and Docker
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0
 
Introduction to Docker Containers - Docker Captain
Introduction to Docker Containers - Docker CaptainIntroduction to Docker Containers - Docker Captain
Introduction to Docker Containers - Docker Captain
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Dockers and kubernetes
Dockers and kubernetesDockers and kubernetes
Dockers and kubernetes
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefits
 
Docker Containers Deep Dive
Docker Containers Deep DiveDocker Containers Deep Dive
Docker Containers Deep Dive
 
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
 
Kubernetes PPT.pptx
Kubernetes PPT.pptxKubernetes PPT.pptx
Kubernetes PPT.pptx
 
Why Docker
Why DockerWhy Docker
Why Docker
 

Similar to Containerization & Docker - Under the Hood

Exploring Docker Security
Exploring Docker SecurityExploring Docker Security
Exploring Docker Security
Patrick Kleindienst
 
Introduction to containers
Introduction to containersIntroduction to containers
Introduction to containers
Nitish Jadia
 
The internals and the latest trends of container runtimes
The internals and the latest trends of container runtimesThe internals and the latest trends of container runtimes
The internals and the latest trends of container runtimes
Akihiro Suda
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
Jérôme Petazzoni
 
Containers > VMs
Containers > VMsContainers > VMs
Containers > VMs
David Timothy Strauss
 
Linux 开源操作系统发展新趋势
Linux 开源操作系统发展新趋势Linux 开源操作系统发展新趋势
Linux 开源操作系统发展新趋势
Anthony Wong
 
OpenVZ Linux Containers
OpenVZ Linux ContainersOpenVZ Linux Containers
OpenVZ Linux Containers
Kirill Kolyshkin
 
Let's Containerize New York with Docker!
Let's Containerize New York with Docker!Let's Containerize New York with Docker!
Let's Containerize New York with Docker!
Jérôme Petazzoni
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1
Binary Studio
 
Security of Linux containers in the cloud
Security of Linux containers in the cloudSecurity of Linux containers in the cloud
Security of Linux containers in the cloud
Dobrica Pavlinušić
 
LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013
dotCloud
 
LXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryLXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software Delivery
Docker, Inc.
 
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo..."Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
Yandex
 
Introduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyIntroduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange County
Jérôme Petazzoni
 
Autentia OS - 20180210 - Docker y las películas de chinos
Autentia OS - 20180210 - Docker y las películas de chinosAutentia OS - 20180210 - Docker y las películas de chinos
Autentia OS - 20180210 - Docker y las películas de chinos
Alejandro Pérez García
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
dotCloud
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Docker, Inc.
 
Docker up and Running For Web Developers
Docker up and Running For Web DevelopersDocker up and Running For Web Developers
Docker up and Running For Web Developers
BADR
 
Docker Up and Running for Web Developers
Docker Up and Running for Web DevelopersDocker Up and Running for Web Developers
Docker Up and Running for Web Developers
Amr Fawzy
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
TheFamily
 

Similar to Containerization & Docker - Under the Hood (20)

Exploring Docker Security
Exploring Docker SecurityExploring Docker Security
Exploring Docker Security
 
Introduction to containers
Introduction to containersIntroduction to containers
Introduction to containers
 
The internals and the latest trends of container runtimes
The internals and the latest trends of container runtimesThe internals and the latest trends of container runtimes
The internals and the latest trends of container runtimes
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
 
Containers > VMs
Containers > VMsContainers > VMs
Containers > VMs
 
Linux 开源操作系统发展新趋势
Linux 开源操作系统发展新趋势Linux 开源操作系统发展新趋势
Linux 开源操作系统发展新趋势
 
OpenVZ Linux Containers
OpenVZ Linux ContainersOpenVZ Linux Containers
OpenVZ Linux Containers
 
Let's Containerize New York with Docker!
Let's Containerize New York with Docker!Let's Containerize New York with Docker!
Let's Containerize New York with Docker!
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1
 
Security of Linux containers in the cloud
Security of Linux containers in the cloudSecurity of Linux containers in the cloud
Security of Linux containers in the cloud
 
LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013
 
LXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryLXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software Delivery
 
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo..."Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
 
Introduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyIntroduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange County
 
Autentia OS - 20180210 - Docker y las películas de chinos
Autentia OS - 20180210 - Docker y las películas de chinosAutentia OS - 20180210 - Docker y las películas de chinos
Autentia OS - 20180210 - Docker y las películas de chinos
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
Docker up and Running For Web Developers
Docker up and Running For Web DevelopersDocker up and Running For Web Developers
Docker up and Running For Web Developers
 
Docker Up and Running for Web Developers
Docker Up and Running for Web DevelopersDocker Up and Running for Web Developers
Docker Up and Running for Web Developers
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
 

Recently uploaded

"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
Introducing BoxLang : A new JVM language for productivity and modularity!
Introducing BoxLang : A new JVM language for productivity and modularity!Introducing BoxLang : A new JVM language for productivity and modularity!
Introducing BoxLang : A new JVM language for productivity and modularity!
Ortus Solutions, Corp
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
UiPathCommunity
 
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...
AlexanderRichford
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
Sease
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Ukraine
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
manji sharman06
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
Fwdays
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
zjhamm304
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
FilipTomaszewski5
 

Recently uploaded (20)

"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
Introducing BoxLang : A new JVM language for productivity and modularity!
Introducing BoxLang : A new JVM language for productivity and modularity!Introducing BoxLang : A new JVM language for productivity and modularity!
Introducing BoxLang : A new JVM language for productivity and modularity!
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
 
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
 

Containerization & Docker - Under the Hood

  • 2. Virtualization Virtualization allows distributed computing models without creating dependencies on physical resources
  • 3. Types of Virtualization ● Native/Full virtualization ● Hardware assisted virtualization ● Para-virtualization ● Containerization (OS level virtualization)
  • 4.
  • 6. Virtualization interest over past 5 years Source: Google Trends
  • 7. Containerization interest over past 5 years Source: Google Trends
  • 8. Docker interest over past 5 years Source: Google Trends
  • 9.
  • 11. Containers vs VMs - Virtualization ● Containers virtualize at the operating system level. ○ Runs on Docker daemon ● Effectively virtualize the operating system. ● Make available protected portions of operating system. ○ Two containers running on the same operating system don't know that they are sharing resources because each has its own abstracted networking layer, processes and so on. ● Use a layer on top of hardware (hypervisor) to make pieces of hardware available for virtual machines to install host OS. ● Hypervisor-based solutions virtualize at the hardware level. ○ “Type 1” (ex: Xen, VMWare ESX) on bare metal hardware ○ “Type 2” (ex: VMWare/VirtualBox open source versions) on the guest OS
  • 12. Containers vs VMs - OS’s and Resources ● Containers run on an already running operating system as the host environment. ○ Executes in spaces that are isolated from each other and from certain parts of the host OS. ● Much efficient resource utilization ○ If a container is not executing anything, no resource is used. ○ Containers can call upon their host OS to satisfy some or all of their dependencies. ● Containers are cheap and therefore fast to create and destroy. ○ Just the cost of creating/stopping processes that run in the isolated space. ○ Similar to starting/stopping a program in our computer. ● Hypervisors only provide access to hardware. We need to install the guest OS by ourselves. ● When an OS per VM is running on the same server, they eats up server resources (CPU, RAM and bandwidth). ○ Inefficient resource utilization because multiple guest OS’s eating up resources (CPU time, etc) unnecessarily. ● Creation and destruction of a VM mean booting up/shutting down an entire OS.
  • 14.
  • 15. Why Docker? ● Docker tries to solve the problem of “dependency hell” ● Imagine being able to package an application along with all of its dependencies easily and then run it smoothly in disparate development, test and production environments Dependency Hell
  • 17. Under the hood ● Processes executing in a Docker container are isolated from processes running on the host OS or in other Docker containers. ○ Nevertheless, all processes are executing in the same kernel ○ Containers sandbox processes from each other ● Docker uses 3 concepts to achieve this OS level virtualization. ○ LXC(Linux Containers) ■ Namespaces - To provide namespaces for containers ■ cgroups (Control Groups) - For resource auditing and limiting ○ copy-on-write filesystem - AuFS (Advanced Multi-Layered Unification Filesystem)
  • 18.
  • 20. LXC Namespaces ● A user-space control package for Linux Containers. ○ Limits what you can see (and therefore use). ● Uses namespaces for isolation at different levels. ○ Uses kernel-level namespaces to isolate the container from the host. ○ User namespace separates the container's and the host's user database, thus ensuring that the container's root user does not have root privileges on the host. ○ The process namespace is responsible for displaying and managing only processes running in the container, not the host. ○ the network namespace provides the container with its own network device and virtual IP address.
  • 21. LXC Namespaces contd ... ● Provide processes with their own view of the system ● Multiple namespaces: ○ pid ○ net ○ mnt ○ uts ○ ipc ○ user ● Each process is in one namespace of each type
  • 22. PID Namespaces ● Processes within a PID namespace only see processes in the same PID namespace. ● Each PID namespace has its own numbering. ○ Starting at 1 ○ When PID 1 goes away, the whole namespace is killed. ● Those namespaces can be nested. ● A process ends up having multiple PIDs ○ One per namespace in which its nested
  • 23. Net Namespaces ● Processes within a given network namespace get their own private network stack, including: ○ network interfaces (including lo) ○ routing tables ○ iptables rules ○ sockets (ss, netstat) ● You can move a network interface from a netns to another ○ ip link set dev eth0 netns PID
  • 24. Mnt Namespaces ● Processes can have their own root fs (chroot) ● Processes can also have "private" mounts ○ /tmp (scoped per user, per service...) ○ Masking of /proc, /sys ○ NFS automounts ● Mounts can be totally private, or shared
  • 25. IPC Namespaces ● Allows a process (or group of processes) to have own: ○ IPC semaphores ○ IPC message queues ○ IPC shared memory ● without risk of conflict with other instances
  • 26. User Namespaces ● Allows to map UID/GID; e.g.: ○ UID 0→1999 in container C1 is mapped to ○ UID 10000→11999 on host ○ UID 0→1999 in container C2 is mapped to ○ UID 12000→13999 on host ○ etc. ● Avoids extra configuration in containers ● UID 0 (root) can be squashed to a non-privileged user ● Security improvement
  • 28. LXC cgroups ● Older than namespaces concept. ● Resource metering and limiting ○ Memory ○ CPU ○ block I/O ○ network ● Device node (/dev/*) access control ● While allowing Docker to limit the resources being consumed by a container also output lots of metrics about these resources. ○ Allow Docker to monitor the resource consumption of the various processes within the containers and make sure that each gets only its fair share of the available resources.
  • 30. Copy-on-write filesystem ● Create a new container instantly ○ Instead of copying its whole filesystem ○ Allows Docker to use certain images as the basis for containers ● Storage keeps track of what has changed ● Many options available ○ AuFS (Advanced Multi-Layered Unification Filesystem), overlay (file level) ○ BTRFS, VFS ○ Device-Mapper ● Considerably reduces footprint and "boot" times
  • 31.
  • 32.
  • 33.
  • 34.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. “Docker equals or exceeds KVM performance in every case we tested”
  • 45. Areas of Evolution ● Kubernetes ● Serverless (FaaS) ○ AWS Lambda ○ Google Cloud Functions ○ Azure Functions ○ IBM OpenWhisk ● Microservices
  • 46.
  • 50. References ● Docker: lightweight linux containers for consistent development and deployment [2014] ● An updated performance comparison of virtual machines and Linux containers [2015] ● https://www.slideshare.net/jpetazzo/anatomy-of-a-container-namespaces- cgroups-some-filesystem-magic-linuxcon ● https://www.slideshare.net/Docker/golubbenarevmspasse- 140402122017phpapp02-37589021 ● https://www.slideshare.net/julienbarbier42/docker-the-future-of-distributed- applications-docker-tour-de-france-2014

Editor's Notes

  1. Full/Native - The virtual machine simulates enough hardware to allow an unmodified "guest" OS (one designed for the same CPU) to be run in isolation. Hardware Assisted - The virtual machine has its own hardware and allows a guest OS to be run in isolation. Paravirtualization - The virtual machine does not necessarily simulate hardware, but instead (or in addition) offers a special API that can only be used by modifying the "guest" OS.
  2. A technology that has been present in Linux kernels for 5+ years and is considered fairly mature.
  3. A layered file system that can transparently overlay one or more existing filesystems. When a process needs to modify a file, AuFS creates a copy of that file. AuFS is capable of merging multiple layers into a single representation of a filesystem. This process is called copy-on-write