SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
Introduction To Docker And
Docker Compose
DevOps and DigitalOcean meetup, Bangalore
whoami
● Lalatendu Mohanty
● @lalatenduM on Twitter
● Software Engineer at Red Hat
● lalatendu.org
Docker
What we want?
● Scalability, maintainability, Agility, Portability.
● DevOps tools.
● Improved resource utilization.
● A continuum of abstraction levels.
Linux Containers
● Use Linux kernel isolation features to give a VM like environment.
● Process isolation /Sandboxing.
● Example: Lxc, lmctfy, Docker, Rkt
Docker
● An easy to use Linux container technology.
● Docker image format.
● It helps in application packaging and delivery.
Docker is a tool that can package an application and its dependencies in a virtual
container that can run on any Linux server. This helps enable flexibility and portability
on where the application can run, whether on premises, public cloud, private cloud,
bare metal, etc. (Wikipedia)
Docker Vs Virtualization
Positive expects of Docker:
● Lighter than Virtual machines.
● Size of docker images are very small compared
● We can run more docker containers on a reasonably sized host.
● Deploying and scaling is relatively easy.
● Containers have less startup time.
Docker Vs Virtualization
Downside:
● Containers share a single kernel on a host.
● Less secure.
● You might need to redesign your application to take benefits.
Technologies behind docker
● Control groups:
○ Control Groups are another key component of Linux Containers
○ With Cgroup we can implement resource accounting and limiting.
○ Ensure that each container gets its fair share of memory, CPU, disk I/O.
○ Thanks to Cgroup, we can make sure that single container cannot bring the system down by
exhausting resources.
● Union file systems:
○ Layered file system so you can have a read only part and a write part, and merge those together.
○ Docker images made up with are layers.
Technologies behind docker
Namespaces
● It helps to create isolated workspace for each process.
● When you run a container, Docker creates a set of namespaces for that container.
SELinux
● SELinux provides secure separation of containers by applying SELinux policy and
labels.
Technologies behind docker
Capabilities:
● By default Docker drops all capabilities except those needed.
● "root" within a container has much less privileges than the real "root".
● The best practice for users would be to remove all capabilities except those
explicitly required for their processes.
● Even if an intruder manages to escalate to root within a container, it will be much
harder to do serious damage, or to escalate to the host
Components
● Docker Images
● Docker containers
● Docker Hub
● Docker Registry
● Docker daemon
● Docker client.
Docker Components
Dockerfiles
● Dockerfile is a text document that contains all the commands a user could call on
the command line to assemble an image.
● docker build can build images using Dockerfile.
● https://github.com/fedora-cloud/Fedora-Dockerfiles
Demo
Link to workshop: http://bit.ly/1Ubah8o
Docker Compose
Let's talk about real life applications first!
● One application consists of multiple containers.
● One container is dependent on another.
● Mutual dependency/ startup order.
● Process involves building containers and then deploy them
● Long docker run commands
● Complexity is proportional to the number of containers involved.
But it is supposed to make our life easy, isn’
t it?
Docker Compose
● Tool for defining and running multi-container Docker application.
● It is a YML file.
● Compose contains information about how to build the containers and deploy
containers.
● Integrated with Docker Swarm.
● Competes with Kubernetes.
Example
● https://docs.docker.com/compose/wordpress/
● https://github.com/docker/example-voting-app
Demo
Questions?
References
● https://docs.docker.com/compose/overview/
● https://docs.docker.com/compose/startup-order/
● https://docs.docker.com/compose/compose-file/

Más contenido relacionado

La actualidad más candente

Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
Docker, Inc.
 

La actualidad más candente (20)

Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker in real life
Docker in real lifeDocker in real life
Docker in real life
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginners
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016
 
Docker Swarm for Beginner
Docker Swarm for BeginnerDocker Swarm for Beginner
Docker Swarm for Beginner
 
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
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefits
 
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
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 
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
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
 

Destacado

Gauge from an end user's perspective-fathima harris
Gauge from an end user's perspective-fathima harrisGauge from an end user's perspective-fathima harris
Gauge from an end user's perspective-fathima harris
VodqaBLR
 

Destacado (20)

Docker compose
Docker composeDocker compose
Docker compose
 
Docker compose and swarm
Docker compose and swarmDocker compose and swarm
Docker compose and swarm
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on Docker
 
Docker Swarm: Docker Native Clustering
Docker Swarm: Docker Native ClusteringDocker Swarm: Docker Native Clustering
Docker Swarm: Docker Native Clustering
 
Docker Online Meetup: Announcing Docker CE + EE
Docker Online Meetup: Announcing Docker CE + EEDocker Online Meetup: Announcing Docker CE + EE
Docker Online Meetup: Announcing Docker CE + EE
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Think Inside Container
Think Inside Container Think Inside Container
Think Inside Container
 
6 Million Ways To Log In Docker - NYC Docker Meetup 12/17/2014
6 Million Ways To Log In Docker - NYC Docker Meetup 12/17/20146 Million Ways To Log In Docker - NYC Docker Meetup 12/17/2014
6 Million Ways To Log In Docker - NYC Docker Meetup 12/17/2014
 
Gauge from an end user's perspective-fathima harris
Gauge from an end user's perspective-fathima harrisGauge from an end user's perspective-fathima harris
Gauge from an end user's perspective-fathima harris
 
Pycon Australia 2015: Docker + Python
Pycon Australia 2015: Docker + PythonPycon Australia 2015: Docker + Python
Pycon Australia 2015: Docker + Python
 
Docker 101 - Intro to Docker
Docker 101 - Intro to DockerDocker 101 - Intro to Docker
Docker 101 - Intro to Docker
 
GlusterFS And Big Data
GlusterFS And Big DataGlusterFS And Big Data
GlusterFS And Big Data
 
Docker 導入:障礙與對策
Docker 導入:障礙與對策Docker 導入:障礙與對策
Docker 導入:障礙與對策
 
Git flow 與團隊合作
Git flow 與團隊合作Git flow 與團隊合作
Git flow 與團隊合作
 
Docker Architecture (v1.3)
Docker Architecture (v1.3)Docker Architecture (v1.3)
Docker Architecture (v1.3)
 
Docker and CloudStack
Docker and CloudStackDocker and CloudStack
Docker and CloudStack
 
OpenShift As A DevOps Platform
OpenShift As A DevOps PlatformOpenShift As A DevOps Platform
OpenShift As A DevOps Platform
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introduction
 
Docker and the Container Ecosystem
Docker and the Container EcosystemDocker and the Container Ecosystem
Docker and the Container Ecosystem
 
認識那條鯨魚 Docker 初探
認識那條鯨魚   Docker 初探認識那條鯨魚   Docker 初探
認識那條鯨魚 Docker 初探
 

Similar a Introduction to docker and docker compose

Similar a Introduction to docker and docker compose (20)

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 quick start
Docker quick startDocker quick start
Docker quick start
 
Docker with WordPress
Docker with WordPressDocker with WordPress
Docker with WordPress
 
Using Docker to boost your development experience with Drupal
Using Docker to boost your development experience with DrupalUsing Docker to boost your development experience with Drupal
Using Docker to boost your development experience with Drupal
 
Docker Container Introduction
Docker Container IntroductionDocker Container Introduction
Docker Container Introduction
 
Docker Interview Questions
Docker Interview QuestionsDocker Interview Questions
Docker Interview Questions
 
Docker - A Quick Introduction Guide
Docker - A Quick Introduction GuideDocker - A Quick Introduction Guide
Docker - A Quick Introduction Guide
 
Introduction to Dockers.pptx
Introduction to Dockers.pptxIntroduction to Dockers.pptx
Introduction to Dockers.pptx
 
Cohesion Techsessie Docker - Daniel Palstra
Cohesion Techsessie Docker - Daniel PalstraCohesion Techsessie Docker - Daniel Palstra
Cohesion Techsessie Docker - Daniel Palstra
 
Docker for dev
Docker for devDocker for dev
Docker for dev
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
JOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to dockerJOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to docker
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
Introduction To Docker, Docker Compose, Docker Swarm
Introduction To Docker, Docker Compose, Docker SwarmIntroduction To Docker, Docker Compose, Docker Swarm
Introduction To Docker, Docker Compose, Docker Swarm
 
JOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in ProductionJOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in Production
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 

Más de Lalatendu Mohanty

Más de Lalatendu Mohanty (11)

Confident OpenShift Upgrades with the Update Graph.pdf
Confident OpenShift Upgrades with the Update Graph.pdfConfident OpenShift Upgrades with the Update Graph.pdf
Confident OpenShift Upgrades with the Update Graph.pdf
 
Reproducible development to live applications with Red Hat CDK and Red Hat Op...
Reproducible development to live applications with Red Hat CDK and Red Hat Op...Reproducible development to live applications with Red Hat CDK and Red Hat Op...
Reproducible development to live applications with Red Hat CDK and Red Hat Op...
 
Contributing To CentOS SIGs
Contributing To CentOS SIGsContributing To CentOS SIGs
Contributing To CentOS SIGs
 
Atomic CLI scan
Atomic CLI scanAtomic CLI scan
Atomic CLI scan
 
Red Hat Container Development Kit
Red Hat Container Development KitRed Hat Container Development Kit
Red Hat Container Development Kit
 
Developer workflow with docker
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with docker
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
 
Project Atomic-Nulecule
Project Atomic-NuleculeProject Atomic-Nulecule
Project Atomic-Nulecule
 
Bringing-it-all-together-overview-of-rpm-packaging-in-fedora
Bringing-it-all-together-overview-of-rpm-packaging-in-fedoraBringing-it-all-together-overview-of-rpm-packaging-in-fedora
Bringing-it-all-together-overview-of-rpm-packaging-in-fedora
 
Running A SIG in CentOS @Devconf Brno 2014
Running A SIG in CentOS @Devconf Brno 2014Running A SIG in CentOS @Devconf Brno 2014
Running A SIG in CentOS @Devconf Brno 2014
 
Introduction to Project atomic (CentOS Dojo Bangalore)
Introduction to Project atomic (CentOS Dojo Bangalore)Introduction to Project atomic (CentOS Dojo Bangalore)
Introduction to Project atomic (CentOS Dojo Bangalore)
 

Último

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Último (20)

Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 

Introduction to docker and docker compose

  • 1. Introduction To Docker And Docker Compose DevOps and DigitalOcean meetup, Bangalore
  • 2. whoami ● Lalatendu Mohanty ● @lalatenduM on Twitter ● Software Engineer at Red Hat ● lalatendu.org
  • 4. What we want? ● Scalability, maintainability, Agility, Portability. ● DevOps tools. ● Improved resource utilization. ● A continuum of abstraction levels.
  • 5. Linux Containers ● Use Linux kernel isolation features to give a VM like environment. ● Process isolation /Sandboxing. ● Example: Lxc, lmctfy, Docker, Rkt
  • 6. Docker ● An easy to use Linux container technology. ● Docker image format. ● It helps in application packaging and delivery. Docker is a tool that can package an application and its dependencies in a virtual container that can run on any Linux server. This helps enable flexibility and portability on where the application can run, whether on premises, public cloud, private cloud, bare metal, etc. (Wikipedia)
  • 7. Docker Vs Virtualization Positive expects of Docker: ● Lighter than Virtual machines. ● Size of docker images are very small compared ● We can run more docker containers on a reasonably sized host. ● Deploying and scaling is relatively easy. ● Containers have less startup time.
  • 8. Docker Vs Virtualization Downside: ● Containers share a single kernel on a host. ● Less secure. ● You might need to redesign your application to take benefits.
  • 9. Technologies behind docker ● Control groups: ○ Control Groups are another key component of Linux Containers ○ With Cgroup we can implement resource accounting and limiting. ○ Ensure that each container gets its fair share of memory, CPU, disk I/O. ○ Thanks to Cgroup, we can make sure that single container cannot bring the system down by exhausting resources. ● Union file systems: ○ Layered file system so you can have a read only part and a write part, and merge those together. ○ Docker images made up with are layers.
  • 10. Technologies behind docker Namespaces ● It helps to create isolated workspace for each process. ● When you run a container, Docker creates a set of namespaces for that container. SELinux ● SELinux provides secure separation of containers by applying SELinux policy and labels.
  • 11. Technologies behind docker Capabilities: ● By default Docker drops all capabilities except those needed. ● "root" within a container has much less privileges than the real "root". ● The best practice for users would be to remove all capabilities except those explicitly required for their processes. ● Even if an intruder manages to escalate to root within a container, it will be much harder to do serious damage, or to escalate to the host
  • 12. Components ● Docker Images ● Docker containers ● Docker Hub ● Docker Registry ● Docker daemon ● Docker client.
  • 14. Dockerfiles ● Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. ● docker build can build images using Dockerfile. ● https://github.com/fedora-cloud/Fedora-Dockerfiles
  • 15. Demo Link to workshop: http://bit.ly/1Ubah8o
  • 17. Let's talk about real life applications first! ● One application consists of multiple containers. ● One container is dependent on another. ● Mutual dependency/ startup order. ● Process involves building containers and then deploy them ● Long docker run commands ● Complexity is proportional to the number of containers involved.
  • 18. But it is supposed to make our life easy, isn’ t it?
  • 19. Docker Compose ● Tool for defining and running multi-container Docker application. ● It is a YML file. ● Compose contains information about how to build the containers and deploy containers. ● Integrated with Docker Swarm. ● Competes with Kubernetes.
  • 21. Demo