SlideShare uma empresa Scribd logo
1 de 46
Baixar para ler offline
Docker Container
Introduction
Personal Profile:
●
Payam Naderi
●
Fullstack Developer at Innfinision Cloud Solutions
●
Payam.Naderi@innfinision.net
●
Innfinision.net
innfinision Cloud Solutions:
●
Providing Cloud, Virtualization and Data Center Solutions
●
Developing Software for Cloud Environments
●
Providing Services to Telecom, Education, Broadcasting & Health Fields
●
Supporting OpenStack Foundation as the First Iranian Company
●
First Supporter of IRAN OpenStack Community
Docker Container Introduction innfinision.net
●
Preface
●
Linux Containers Preface
●
Linux Container Concepts
●
LXC Copy On Write Filesystem
●
Docker Preface
●
Introduction Container Image
●
Why Docker
●
Docker Architecture
Agenda:
●
Docker Architect, How Working
●
Underlying Technology
●
Immutable infrastructure with Docker
Preface
innfinision.netDocker Container Introduction
Virtualization / Containerization
innfinision.net
How changed the data center and cloud forever
● More Agile
●
Manageable
●
Cloud Friendly
●
Application Friendly
The Containerization technology is seeing resurgence with Docker.
Docker has revived the interest of the technology community in
containers.
Docker Container Introduction
Fundamental Containerization Support
innfinision.net
Containerization was actually included in the Linux 2.6.24 called LXC.
Linux Container (LXC)
● Provide System-Level Virtualization
●
Allow Single Host to Operate Multiple Isolated Linux Instances.
●
Based on Linux cGroup
LXC Make Complete App. Isolation
●
Linux cGroup Offer Complete App Isolation include Process, Memory, IO
●
Namespaces Offer Filesystem, UserID, NetworkID, GroupID ...
Docker Container Introduction
Docker Uses Container Technology
innfinision.net
Docker uses the container technology but creates a layer above the LXC.
Use Containers for
● Packaging
●
Deployment
●
Migration of Workload to different hosts.
Docker is well suited for Clouds
●
Reducing the datacenter footprint and using the host’s resources
to their maximum using the Docker and LXC technology.
●
Ease of migration and fast scale out of containers.
Docker Container Introduction
Linux Containers Preface
innfinision.netDocker Container Introduction
Virtualization OS
innfinision.net
Refers to the creation of virtual machines which have an
independent operating systems but the execution of software
running on the virtual machine is separated from the underlying
hardware resources.
Docker Container Introduction
Virtualization OS
innfinision.net
Naming VM. Elements
● Host Machine: The actual machine that runs the virtualization software
●
Guest Machine: The virtual machine running on top of the virtualization
software.
●
Virtual Machine Manager or a Hypervisor: The software that provides
virtualization capabilities and abstracts the hardware.
Docker Container Introduction
Virtualization Vs Containerization
innfinision.net
Linux containers have a different approach than virtualization; you
may call it an OS level virtualization.
Container Virtualization
● Fully Isolated OS on Same Host Kernel
● Containers isolate the guest but do not virtualize the hardware
● Limited to a single operating system, thus you cannot run Linux and
windows together
● Work on the Concept of Process Level Virtualization
Docker Container Introduction
innfinision.netDocker Container Introduction
Linux Container
innfinision.netDocker Container Introduction
Linux Container
innfinision.net
Docker works on a technology called
Linux containers.
There are two main concepts
involved within Linux Containers,
Namespaces
Cgroups (Control groups.)
Docker Container Introduction
Namespaces
innfinision.net
●
Offer process level isolation for Linux resources.
●
Ensure that each container sees only its own environment and
doesn’t affect or get access to processes running inside other
containers.
Docker Container Introduction
Different Kinds of Namespaces
innfinision.net
● PID: Considered as most important isolation factor in containers.
● NET: Controlling the networks and net interfaces.
● MNT: Isolates the file system mount points.
● UTS: Isolation for hostname and NIS domain name.
● USER: Isolates the user and group ID namespaces.
Docker Container Introduction
cGroups (control groups)
innfinision.net
cGroups (control groups) is a feature of Linux kernel for accounting,
limiting and isolation of resources.
It provides means to restrict resources that a process can use.
Linux container is basically a process or a set of processes that can
run in an isolated environment on the host system.
Docker Container Introduction
Copy On Write File System
innfinision.netDocker Container Introduction
Copy On Write Filesystem
innfinision.net
●
Never overwrites the live data
●
It does all the updating using the existing unused blocks in the disk
using copy on write functionality
●
The new data will be live only when all the data has been updated
to the disk
Docker Container Introduction
Copy On Write Filesystem
innfinision.netDocker Container Introduction
innfinision.net
●
Resources are handles using Copy on Write (COW) when same data is
utilized by multiple tasks.
●
Is a read-only, point-in-time copy of the file system state
●
Storage snapshot is created using predesignated space allocated to it
●
Whenever a snapshot is created, the metadata associated with the
original data is stored as a copy
●
Snapshot does not create a physical copy and creation of a snapshot is
nearly immediate
BTRFS
Docker Container Introduction
Advantages of copy-on-write technique
innfinision.net
●
Space efficiency is main
advantage
●
More performance but
impacted by cow technique
Docker Container Introduction
Docker ?
innfinision.netDocker Container Introduction
Docker
innfinision.net
From the Docker web site—Docker is “an open source project to
pack, ship and run any application as a lightweight container.”
Docker platform can be used by developers and system
administrators for developing and shipping applications to different
environments.
Docker Container Introduction
Docker Leverage
innfinision.net
● LXC (Linux Containers)
● Docker is not limited to LXC but can use any other container
technology like libcontainer
● Copy-on-Write file system
● “Plain Text” configuration
● Containers sit on top of a union file system
Docker Container Introduction
Introduction Container Image
innfinision.netDocker Container Introduction
Container Image
innfinision.net
A container is started from an image, which may be locally created,
cached locally, or downloaded from a registry.
Docker Container Introduction
Create Aplication Packages for Containers
innfinision.net
● Manual builds
A manual build starts by launching a container with a base operating
system image. Normal process for installation of an application on the
operating system is performed.
● Docker File
This method is more scripted and automated for construction of a
Docker Container.
Docker Container Introduction
Why to use Docker
innfinision.netDocker Container Introduction
Why to use Docker
innfinision.net
● Portable Deployments
Can be deployed to various environments without making any
changes to the container
● Fast application delivery
● Scale and deploy with ease
Scaling up and down containers is blazingly fast
● Higher workloads with greater density
More container applications can be deployed on a host when
compared to virtual machines
Docker Container Introduction
Docker Architecture
innfinision.netDocker Container Introduction
Docker Architecture
innfinision.net
● Docker has client server architecture. The Docker client instructs the
Docker daemon for all the container specific tasks.
● Docker daemon is carried out through sockets or through REST APIs.
● Docker client and Docker daemon can be on the same host or different
hosts.
Docker Container Introduction
Docker Architecture
innfinision.netDocker Container Introduction
Docker internal components
innfinision.net
● Docker image – base image
An image consists of OS (Ubuntu, CentOS etc.,) and applications
installed on it.
● Docker registry
Docker registry is a repository for Docker images. It can be public or
private.
The public Docker registry maintained by Docker is called Docker hub.
Docker Container Introduction
Docker internal components
innfinision.net
● Docker Container
It is created on top of a Docker image and it is completely isolated.
has its own user space, networking and security settings and holds all
the necessary files and configurations for running an application.
Docker Container Introduction
How Docker Works
innfinision.netDocker Container Introduction
Working of Docker image
innfinision.net
Each Docker image is an association of various layers.These layers
are combined in to a single unit using Uniform file system (AUFS).
AUFS stores every layer as a normal directory, files with AUFS
metadata. This ensures that all the files and directories are unique to
the particular layer.
Docker Container Introduction
Working of Docker image
innfinision.net
An image consists of OS (Ubuntu, centos etc.,) and applications installed on it.
Docker Container Introduction
Working of Docker registry
innfinision.net
Public registry (Docker hub): It contains official Docker images and user
created images.
● Private registry: A registry created by a user for storing private Docker
images in your datacenter.
Docker Container Introduction
How container works
innfinision.net
Container is an execution environment for applications. It contains all
the operating system files, files added by users and metadata.
Container is launched from an image, As the images are in read only
format, when a container is launched, a read/write layer will be added
on top of the image for the container for the applications to run and
make changes to it.
Docker Container Introduction
innfinision.net
How container works
Docker Container Introduction
Simple Command To Build Docker
Container
innfinision.netDocker Container Introduction
innfinision.net
● Docker checks the specified Docker image If it is present locally,
Docker will use that image for creating a container. If not, it will
download the image from the registry (based on the Docker host
configuration) on the host.
● The local or pulled image will be used for creating a new container.
● Once the image is set, Docker will create a read/write file system over
the image.
Sudo docker run -i -t ubuntu /bin/bash
Docker Container Introduction
innfinision.net
● Then Docker creates the necessary network interfaces for the container
to interact with the host machine.
● Docker checks for available IP address from the pool and allocates one to
the container.
● Then it executes the command specified in the command e.g. /bin/bash shell
● Finally it logs all the input/output and errors for the user to find out the
status of the container.
Sudo docker run -i -t ubuntu /bin/bash
Docker Container Introduction
Payam Naderi
Payam.Naderi@innfinision.net
innfinision.net
Thank you

Mais conteúdo relacionado

Mais procurados

Why Docker
Why DockerWhy Docker
Why Docker
dotCloud
 
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
 

Mais procurados (20)

Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
 
Introduction to Docker - 2017
Introduction to Docker - 2017Introduction to Docker - 2017
Introduction to Docker - 2017
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
 
Why Docker
Why DockerWhy Docker
Why Docker
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefits
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and How
 
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
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
 
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 swarm
Docker swarmDocker swarm
Docker swarm
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Kubernetes in Docker
Kubernetes in DockerKubernetes in Docker
Kubernetes in Docker
 

Semelhante a Docker Container Introduction

Semelhante a Docker Container Introduction (20)

Docker for developers
Docker for developersDocker for developers
Docker for 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
 
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 handons-workshop-for-charity
Docker handons-workshop-for-charityDocker handons-workshop-for-charity
Docker handons-workshop-for-charity
 
Docker Fundamentals
Docker FundamentalsDocker Fundamentals
Docker Fundamentals
 
Docker - A curtain raiser to the Container world
Docker - A curtain raiser to the Container worldDocker - A curtain raiser to the Container world
Docker - A curtain raiser to the Container world
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
Docker
DockerDocker
Docker
 
Docker.pptx
Docker.pptxDocker.pptx
Docker.pptx
 
What is Docker?
What is Docker?What is Docker?
What is Docker?
 
Let's dockerize
Let's dockerizeLet's dockerize
Let's dockerize
 
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
 
Docker
Docker Docker
Docker
 
Introduction to Containers & Diving a little deeper into the benefits of Con...
 Introduction to Containers & Diving a little deeper into the benefits of Con... Introduction to Containers & Diving a little deeper into the benefits of Con...
Introduction to Containers & Diving a little deeper into the benefits of Con...
 
The Docker Ecosystem
The Docker EcosystemThe Docker Ecosystem
The Docker Ecosystem
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Docker with WordPress
Docker with WordPressDocker with WordPress
Docker with WordPress
 
Journey to the devops automation with docker kubernetes and openshift
Journey to the devops automation with docker kubernetes and openshiftJourney to the devops automation with docker kubernetes and openshift
Journey to the devops automation with docker kubernetes and openshift
 
containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )
 
Introduction to Dockers.pptx
Introduction to Dockers.pptxIntroduction to Dockers.pptx
Introduction to Dockers.pptx
 

Mais de Innfinision Cloud and BigData Solutions (6)

BigData Analysis
BigData AnalysisBigData Analysis
BigData Analysis
 
OpenStack as an Infrastructure
OpenStack as an InfrastructureOpenStack as an Infrastructure
OpenStack as an Infrastructure
 
OpenStack Introduction
OpenStack IntroductionOpenStack Introduction
OpenStack Introduction
 
OpenStack vs VMware vCloud
OpenStack vs VMware vCloudOpenStack vs VMware vCloud
OpenStack vs VMware vCloud
 
oVirt introduction
oVirt introductionoVirt introduction
oVirt introduction
 
Large Data Analyze With PyTables
Large Data Analyze With PyTablesLarge Data Analyze With PyTables
Large Data Analyze With PyTables
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Docker Container Introduction

  • 2. Personal Profile: ● Payam Naderi ● Fullstack Developer at Innfinision Cloud Solutions ● Payam.Naderi@innfinision.net ● Innfinision.net
  • 3. innfinision Cloud Solutions: ● Providing Cloud, Virtualization and Data Center Solutions ● Developing Software for Cloud Environments ● Providing Services to Telecom, Education, Broadcasting & Health Fields ● Supporting OpenStack Foundation as the First Iranian Company ● First Supporter of IRAN OpenStack Community
  • 4. Docker Container Introduction innfinision.net ● Preface ● Linux Containers Preface ● Linux Container Concepts ● LXC Copy On Write Filesystem ● Docker Preface ● Introduction Container Image ● Why Docker ● Docker Architecture Agenda: ● Docker Architect, How Working ● Underlying Technology ● Immutable infrastructure with Docker
  • 6. Virtualization / Containerization innfinision.net How changed the data center and cloud forever ● More Agile ● Manageable ● Cloud Friendly ● Application Friendly The Containerization technology is seeing resurgence with Docker. Docker has revived the interest of the technology community in containers. Docker Container Introduction
  • 7. Fundamental Containerization Support innfinision.net Containerization was actually included in the Linux 2.6.24 called LXC. Linux Container (LXC) ● Provide System-Level Virtualization ● Allow Single Host to Operate Multiple Isolated Linux Instances. ● Based on Linux cGroup LXC Make Complete App. Isolation ● Linux cGroup Offer Complete App Isolation include Process, Memory, IO ● Namespaces Offer Filesystem, UserID, NetworkID, GroupID ... Docker Container Introduction
  • 8. Docker Uses Container Technology innfinision.net Docker uses the container technology but creates a layer above the LXC. Use Containers for ● Packaging ● Deployment ● Migration of Workload to different hosts. Docker is well suited for Clouds ● Reducing the datacenter footprint and using the host’s resources to their maximum using the Docker and LXC technology. ● Ease of migration and fast scale out of containers. Docker Container Introduction
  • 10. Virtualization OS innfinision.net Refers to the creation of virtual machines which have an independent operating systems but the execution of software running on the virtual machine is separated from the underlying hardware resources. Docker Container Introduction
  • 11. Virtualization OS innfinision.net Naming VM. Elements ● Host Machine: The actual machine that runs the virtualization software ● Guest Machine: The virtual machine running on top of the virtualization software. ● Virtual Machine Manager or a Hypervisor: The software that provides virtualization capabilities and abstracts the hardware. Docker Container Introduction
  • 12. Virtualization Vs Containerization innfinision.net Linux containers have a different approach than virtualization; you may call it an OS level virtualization. Container Virtualization ● Fully Isolated OS on Same Host Kernel ● Containers isolate the guest but do not virtualize the hardware ● Limited to a single operating system, thus you cannot run Linux and windows together ● Work on the Concept of Process Level Virtualization Docker Container Introduction
  • 15. Linux Container innfinision.net Docker works on a technology called Linux containers. There are two main concepts involved within Linux Containers, Namespaces Cgroups (Control groups.) Docker Container Introduction
  • 16. Namespaces innfinision.net ● Offer process level isolation for Linux resources. ● Ensure that each container sees only its own environment and doesn’t affect or get access to processes running inside other containers. Docker Container Introduction
  • 17. Different Kinds of Namespaces innfinision.net ● PID: Considered as most important isolation factor in containers. ● NET: Controlling the networks and net interfaces. ● MNT: Isolates the file system mount points. ● UTS: Isolation for hostname and NIS domain name. ● USER: Isolates the user and group ID namespaces. Docker Container Introduction
  • 18. cGroups (control groups) innfinision.net cGroups (control groups) is a feature of Linux kernel for accounting, limiting and isolation of resources. It provides means to restrict resources that a process can use. Linux container is basically a process or a set of processes that can run in an isolated environment on the host system. Docker Container Introduction
  • 19. Copy On Write File System innfinision.netDocker Container Introduction
  • 20. Copy On Write Filesystem innfinision.net ● Never overwrites the live data ● It does all the updating using the existing unused blocks in the disk using copy on write functionality ● The new data will be live only when all the data has been updated to the disk Docker Container Introduction
  • 21. Copy On Write Filesystem innfinision.netDocker Container Introduction
  • 22. innfinision.net ● Resources are handles using Copy on Write (COW) when same data is utilized by multiple tasks. ● Is a read-only, point-in-time copy of the file system state ● Storage snapshot is created using predesignated space allocated to it ● Whenever a snapshot is created, the metadata associated with the original data is stored as a copy ● Snapshot does not create a physical copy and creation of a snapshot is nearly immediate BTRFS Docker Container Introduction
  • 23. Advantages of copy-on-write technique innfinision.net ● Space efficiency is main advantage ● More performance but impacted by cow technique Docker Container Introduction
  • 25. Docker innfinision.net From the Docker web site—Docker is “an open source project to pack, ship and run any application as a lightweight container.” Docker platform can be used by developers and system administrators for developing and shipping applications to different environments. Docker Container Introduction
  • 26. Docker Leverage innfinision.net ● LXC (Linux Containers) ● Docker is not limited to LXC but can use any other container technology like libcontainer ● Copy-on-Write file system ● “Plain Text” configuration ● Containers sit on top of a union file system Docker Container Introduction
  • 28. Container Image innfinision.net A container is started from an image, which may be locally created, cached locally, or downloaded from a registry. Docker Container Introduction
  • 29. Create Aplication Packages for Containers innfinision.net ● Manual builds A manual build starts by launching a container with a base operating system image. Normal process for installation of an application on the operating system is performed. ● Docker File This method is more scripted and automated for construction of a Docker Container. Docker Container Introduction
  • 30. Why to use Docker innfinision.netDocker Container Introduction
  • 31. Why to use Docker innfinision.net ● Portable Deployments Can be deployed to various environments without making any changes to the container ● Fast application delivery ● Scale and deploy with ease Scaling up and down containers is blazingly fast ● Higher workloads with greater density More container applications can be deployed on a host when compared to virtual machines Docker Container Introduction
  • 33. Docker Architecture innfinision.net ● Docker has client server architecture. The Docker client instructs the Docker daemon for all the container specific tasks. ● Docker daemon is carried out through sockets or through REST APIs. ● Docker client and Docker daemon can be on the same host or different hosts. Docker Container Introduction
  • 35. Docker internal components innfinision.net ● Docker image – base image An image consists of OS (Ubuntu, CentOS etc.,) and applications installed on it. ● Docker registry Docker registry is a repository for Docker images. It can be public or private. The public Docker registry maintained by Docker is called Docker hub. Docker Container Introduction
  • 36. Docker internal components innfinision.net ● Docker Container It is created on top of a Docker image and it is completely isolated. has its own user space, networking and security settings and holds all the necessary files and configurations for running an application. Docker Container Introduction
  • 37. How Docker Works innfinision.netDocker Container Introduction
  • 38. Working of Docker image innfinision.net Each Docker image is an association of various layers.These layers are combined in to a single unit using Uniform file system (AUFS). AUFS stores every layer as a normal directory, files with AUFS metadata. This ensures that all the files and directories are unique to the particular layer. Docker Container Introduction
  • 39. Working of Docker image innfinision.net An image consists of OS (Ubuntu, centos etc.,) and applications installed on it. Docker Container Introduction
  • 40. Working of Docker registry innfinision.net Public registry (Docker hub): It contains official Docker images and user created images. ● Private registry: A registry created by a user for storing private Docker images in your datacenter. Docker Container Introduction
  • 41. How container works innfinision.net Container is an execution environment for applications. It contains all the operating system files, files added by users and metadata. Container is launched from an image, As the images are in read only format, when a container is launched, a read/write layer will be added on top of the image for the container for the applications to run and make changes to it. Docker Container Introduction
  • 43. Simple Command To Build Docker Container innfinision.netDocker Container Introduction
  • 44. innfinision.net ● Docker checks the specified Docker image If it is present locally, Docker will use that image for creating a container. If not, it will download the image from the registry (based on the Docker host configuration) on the host. ● The local or pulled image will be used for creating a new container. ● Once the image is set, Docker will create a read/write file system over the image. Sudo docker run -i -t ubuntu /bin/bash Docker Container Introduction
  • 45. innfinision.net ● Then Docker creates the necessary network interfaces for the container to interact with the host machine. ● Docker checks for available IP address from the pool and allocates one to the container. ● Then it executes the command specified in the command e.g. /bin/bash shell ● Finally it logs all the input/output and errors for the user to find out the status of the container. Sudo docker run -i -t ubuntu /bin/bash Docker Container Introduction