SlideShare une entreprise Scribd logo
1  sur  42
Introduction to Docker
Virtualization Using Containers
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
➢used technologies
➢usage
➢future
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
➢used technologies
➢usage
➢future
Who is Docker
“Docker is an open source platform for developers and
sysadmins of distributed apps.”
Docker, Inc. is the company behind Docker
dotCloud → Y Combinator → 20.000$ → SF!
Who uses it?
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
➢used technologies
➢usage
➢future
What is application-level virtualization
Three types of virtualization technologies
1. emulation
2. virtualization
3. containers
Contents
➢a company and a platform
➢application-level virtualization
○ hw emulation
○ os virtualization
○ app containers
➢benefits
➢used technologies
➢usage
➢future
Emulation
hardware (cpu, ram, disk, etc.) is emulated
o e.g., QEMU
o allows:
| Application |
| Solaris |
| “emulation (e.g., of sparc)” |
| OS (e.g., Linux) |
| PC (e.g., intel) |
Contents
➢a company and a platform
➢application-level virtualization
○ hw emulation
○ os virtualization
○ app containers
➢benefits
➢used technologies
➢usage
➢future
Virtualization (VMs)
virtualization with same hardware
o e.g., VmWare, Virtualbox, Xen..
o allows:
| Application |
| Windows |
| “virtualization engine” |
| OS (e.g., Linux) |
| PC (e.g., intel) |
Contents
➢a company and a platform
➢application-level virtualization
○ hw emulation
○ os virtualization
○ app containers
➢benefits
➢used technologies
➢usage
➢future
Containers
an execution environment is virtualized
o e.g., Solaris Zones, Linux LXC, Docker..
o allows:
| Application |
| Linux-ubuntu’s rootFS2 |
| “Linux docker engine” |
| Linux-centOS, rootFS1 |
| PC (e.g., intel) |
o Note: other app-level isolation:
 virtualenv, ruby rvm, go gvm..
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
➢used technologies
➢usage
➢future
Why use Docker
Some benefits of virtualizing applications are:
1. isolation
2. portability, shipping applications
3. specification of a complex system
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
○ isolation
○ portability
○ specification
➢used technologies
➢usage
➢future
Isolation
● set of minimal functions with fewer resources than VMs,
o app isolated from other apps
o app isolated from OS
→ protects OS and apps from bugs in one app
o but without much performance loss
● secure sandboxes,
o principle of least privilege
● (future) manage resource usage (limit, prio, measure)
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
○ isolation
○ portability
○ specification
➢used technologies
➢usage
➢future
Portability, Shipping Applications
❖ One App =
➢ binaries (exec, libs, etc.)
➢ data (assets, SQL DB, etc.)
➢ configs (/etc/config/files)
➢ logs
either in a container
or a composition
Portability (2)
Docker promise: Build, Ship, Run!
○ reliable deployments
○ develop here, run there
Portability (3)
a Pivot-Oriented Approach
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
○ isolation
○ portability
○ specification
➢used technologies
➢usage
➢future
Specification of a complex system
● Developers use Version Control Systems (Mercurial,
git)
● DevOps use VCS as well for docs and scripts
o ascii docs, chef, puppet, ansible, salt stack, …
o and… Dockerfiles!
● Docker allows to version-control complex specifications:
o Dockerfile: how to build images
o docker-compose.yml: how to orchestrate them
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
➢used technologies
➢usage
➢future
How does Docker work
Used technologies:
1. lightweight virtualization
2. incremental images
3. Docker Hub: an image registry
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
➢used technologies
○ lightweight virtualization
○ incremental images
○ images registry
➢usage
➢future
Lightweight Virtualization
● Docker is based on Linux technologies
o namespaces, cgroups, capabilities
o driver = LXC
o or now → driver = Libcontainer
 a standard interface to making containers
● Benefits
o low memory footprint
o low disk footprint (see incremetal images after)
o fast startup
Lightweight Virtualization (2)
● High level: we have a “lightweight VM”
o own process space
o own network interface
o can run as root
o can have its own /sbin/init
● Low level: “chroot on steroids”
o can also not have its own /sbin/init
o share kernel with host
o no device emulation
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
➢used technologies
○ lightweight virtualization
○ incremental images
○ images registry
➢usage
➢future
Incremental Images
● UnionFS
o files from separate FS
(branches) can be overlaid
o forming a single coherent FS
o branches may be read-only or read-write
● Docker Layers
o each layer is mounted on top of prior layers
o first layer = base image (scratch, busybox, ubuntu,..)
o a read-only layer = an image
o the top read-write layer = container
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
➢used technologies
○ lightweight virtualization
○ incremental images
○ images registry
➢usage
➢future
Docker Hub: an image registry
● part of the Docker ecosystem
o makes it easy to publish, search, and run containers
o private
or public
registries
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
➢used technologies
➢usage
➢future
How to build and run hello/Dockerfile
$ cat Dockerfile
FROM ubuntu ← on top of a “base image”
RUN touch /hello ← each instruction is cached
$ docker build -t hello .
Step 0 : FROM ubuntu:14.04
---> 9bd07e480c5b
Step 1 : RUN touch /hello
---> Running in b8dd4e965482
---> 164c3bf53715
Removing intermediate container b8dd4e965482
Successfully built 164c3bf53715
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
hello latest 164c3bf53715 38 seconds ago 192.7 MB
$ docker run -i -t hello /bin/bash ← specify a command to be run
root@1a210c0a1846:/# ls -ls /hello
0 -rw-r--r-- 1 root root 0 May 18 14:31 /hello
Dockerfiles (1)
e.g., a jenkins slave: python2slave/Dockerfile
FROM ubuntu:14.04 ← on top of a “base image” with tagged version specified
RUN adduser --quiet jenkins
RUN apt-get update && apt-get install -y python2.7 openssh-server
RUN mkdir -p /var/run/sshd ← create a dir
RUN apt-get install -y --no-install-recommends openjdk-7-jdk
[...]
RUN apt-get install -y python-argparse python-gdata python-pip
RUN pip install --upgrade python-redmine
COPY credentials/ /home/jenkins/credentials ← copy local data into the image
RUN chown -R jenkins:jenkins /home/jenkins/credentials/
EXPOSE 22 ← open only one port
CMD ["/usr/sbin/sshd", "-D"] ← finally run the app
Dockerfiles (2)
e.g., a nodejs serveur: docker_sinopia/Dockerfile
FROM dockerfile/nodejs ← on top of a more complex “base image”
MAINTAINER Keyvan Fatehi <keyvanfatehi@gmail.com> ← maintainer contact
RUN adduser --disabled-password --gecos "" sinopia
RUN mkdir -p /opt/sinopia/storage
WORKDIR /opt/sinopia
RUN npm install js-yaml sinopia
RUN chown -R sinopia:sinopia /opt/sinopia
USER sinopia ← sets the user id to use when running the image
ADD /config_gen.js /opt/sinopia/config_gen.js
ADD /start.sh /opt/sinopia/start.sh
EXPOSE 4873 ← open only one port
VOLUME /opt/sinopia ← make this directory accessible to other containers (or host)
CMD ["/opt/sinopia/start.sh"] ← finally run the app
from build and run → to pull and run
● reminder: an image can be stored in the Hub
How to pull and run docker_sinopia
[ (optional) $ docker pull keyvanfatehi/sinopia:latest ]
$ docker run --name sinopia -d -p 4873:4873 keyvanfatehi/sinopia:latest
$ docker logs -f sinopia
edit config (launch an ubuntu image with app=vi):
$ docker stop sinopia
$ docker run --volumes-from sinopia -it --rm ubuntu vi /opt/sinopia/config.yaml
$ docker start sinopia
$ docker logs -f sinopia
backup (find where a volume is located on the host)
$ crontab -l
59 * * * 1-5 /usr/bin/rsync -av `docker inspect sinopia | egrep
'/opt/sinopia.*/vfs/' | cut -d" -f4`/ /opt/sinopia >> /tmp/rsync.txt 2>&1
(Note: /opt/sinopia=/opt/docker/vfs/dir/6e20429fcad2e82be8b3…72d9a464ab8622b15)
How to orchestrate docker_jenkins
E.g., a jenkins master = a data container + a server container:
$ docker run -v /var/jenkins_home --name=data busybox true
$ docker build -t myjenkins .
$ docker run -d -u root -p 8081:8080 -p 50001:50001 --volumes-from=data --
name=master myjenkins
or:
$ vi docker-compose.yml
data:
image: busybox
volumes:
- /var/jenkins_home
master:
build .
ports:
- 50001:50000
volumes_from:
- data
$ docker-compose up
Contents
➢a company and a platform
➢application-level virtualization
➢benefits
➢used technologies
➢usage
➢future
Where are we going
● Competing standards: e.g., rkt from CoreOS
● Docker: native clustering, security, hub, …
o swarm: heterogeneous nodes, load balancing
o security: capabilities, image signing
o intranet “Docker Hubs”
● Where am I going:
o use orchestration (e.g., docker-compose , Kubernetes)
o use resource control (e.g., nofile limit)
o docker-level monitoring
o mixing Docker and Ansible
Docker vs Configuration Tools
Before
use Ansible to
● setup hardware/VM,
● install packages,
● deploy code,
● run services.
After
use Ansible to
● setup hardware/VM,
● install Docker,
● run containers.
use Dockerfiles to
● install packages,
● deploy code,
● run services.
End
Questions?
on-line tutorial: https://www.docker.com/tryit/

Contenu connexe

Tendances

Docker introduction for Carbon IT
Docker introduction for Carbon ITDocker introduction for Carbon IT
Docker introduction for Carbon ITyannick grenzinger
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerInstruqt
 
The ABC of Docker: The Absolute Best Compendium of Docker
The ABC of Docker: The Absolute Best Compendium of DockerThe ABC of Docker: The Absolute Best Compendium of Docker
The ABC of Docker: The Absolute Best Compendium of DockerAniekan Akpaffiong
 
Docker based-pipelines
Docker based-pipelinesDocker based-pipelines
Docker based-pipelinesDevOps.com
 
Virtual Machines and Docker
Virtual Machines and DockerVirtual Machines and Docker
Virtual Machines and DockerDanish Khakwani
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionHao Fan
 
Docker and containers : Disrupting the virtual machine(VM)
Docker and containers : Disrupting the virtual machine(VM)Docker and containers : Disrupting the virtual machine(VM)
Docker and containers : Disrupting the virtual machine(VM)Rama Krishna B
 
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Docker Intro at the Google Developer Group and Google Cloud Platform Meet UpDocker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Docker Intro at the Google Developer Group and Google Cloud Platform Meet UpJérôme Petazzoni
 
Understand how docker works
Understand how docker worksUnderstand how docker works
Understand how docker worksJustin Li
 
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...Yogesh Wadile
 
Docker - The Linux Container
Docker - The Linux ContainerDocker - The Linux Container
Docker - The Linux ContainerBalaji Rajan
 
Docker 101 - High level introduction to docker
Docker 101 - High level introduction to dockerDocker 101 - High level introduction to docker
Docker 101 - High level introduction to dockerDr Ganesh Iyer
 
Docker introduction
Docker introductionDocker introduction
Docker introductionJo Ee Liew
 
Docker introduction
Docker introductionDocker introduction
Docker introductionPhuc Nguyen
 
Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginnersJuneyoung Oh
 
Introduction to Containers and Docker
Introduction to Containers and DockerIntroduction to Containers and Docker
Introduction to Containers and DockerRob Loach
 

Tendances (20)

Docker introduction for Carbon IT
Docker introduction for Carbon ITDocker introduction for Carbon IT
Docker introduction for Carbon IT
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
The ABC of Docker: The Absolute Best Compendium of Docker
The ABC of Docker: The Absolute Best Compendium of DockerThe ABC of Docker: The Absolute Best Compendium of Docker
The ABC of Docker: The Absolute Best Compendium of Docker
 
Docker based-pipelines
Docker based-pipelinesDocker based-pipelines
Docker based-pipelines
 
Virtual Machines and Docker
Virtual Machines and DockerVirtual Machines and Docker
Virtual Machines and Docker
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Introduction To Docker
Introduction To  DockerIntroduction To  Docker
Introduction To Docker
 
Docker and containers : Disrupting the virtual machine(VM)
Docker and containers : Disrupting the virtual machine(VM)Docker and containers : Disrupting the virtual machine(VM)
Docker and containers : Disrupting the virtual machine(VM)
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Docker Intro at the Google Developer Group and Google Cloud Platform Meet UpDocker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
 
Introduction to container based virtualization with docker
Introduction to container based virtualization with dockerIntroduction to container based virtualization with docker
Introduction to container based virtualization with docker
 
Understand how docker works
Understand how docker worksUnderstand how docker works
Understand how docker works
 
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
 
Docker - The Linux Container
Docker - The Linux ContainerDocker - The Linux Container
Docker - The Linux Container
 
Docker 101 - High level introduction to docker
Docker 101 - High level introduction to dockerDocker 101 - High level introduction to docker
Docker 101 - High level introduction to docker
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
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
 
Introduction to Containers and Docker
Introduction to Containers and DockerIntroduction to Containers and Docker
Introduction to Containers and Docker
 

Similaire à Introduction to docker

Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 applicationRoman Rodomansky
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesJérôme Petazzoni
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by DockerTerry Chen
 
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 PetazzoniTheFamily
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionJérôme Petazzoni
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned RightScale
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Partner S.A.
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortalsHenryk Konsek
 
Docker - A Ruby Introduction
Docker - A Ruby IntroductionDocker - A Ruby Introduction
Docker - A Ruby IntroductionTyler Johnston
 
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandPRIYADARSHINI ANAND
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and ContainersDocker, Inc.
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Ben Hall
 
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...NLJUG
 

Similaire à Introduction to docker (20)

Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los Angeles
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
 
From zero to Docker
From zero to DockerFrom zero to Docker
From zero to Docker
 
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
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Docker - A Ruby Introduction
Docker - A Ruby IntroductionDocker - A Ruby Introduction
Docker - A Ruby Introduction
 
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini Anand
 
Introducing Docker
Introducing DockerIntroducing Docker
Introducing Docker
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and Containers
 
Docker
DockerDocker
Docker
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
Intro To Docker
Intro To DockerIntro To Docker
Intro To Docker
 
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
 
Docker+java
Docker+javaDocker+java
Docker+java
 
Docker 101
Docker 101 Docker 101
Docker 101
 

Dernier

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
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 ...OnePlan Solutions
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
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 🔝✔️✔️Delhi Call girls
 
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 WorkerThousandEyes
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
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.jsAndolasoft Inc
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
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.pdfWave PLM
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 

Dernier (20)

Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
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 ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female 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 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
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
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
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
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
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
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 

Introduction to docker

  • 2. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ➢used technologies ➢usage ➢future
  • 3. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ➢used technologies ➢usage ➢future
  • 4. Who is Docker “Docker is an open source platform for developers and sysadmins of distributed apps.” Docker, Inc. is the company behind Docker dotCloud → Y Combinator → 20.000$ → SF! Who uses it?
  • 5. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ➢used technologies ➢usage ➢future
  • 6. What is application-level virtualization Three types of virtualization technologies 1. emulation 2. virtualization 3. containers
  • 7. Contents ➢a company and a platform ➢application-level virtualization ○ hw emulation ○ os virtualization ○ app containers ➢benefits ➢used technologies ➢usage ➢future
  • 8. Emulation hardware (cpu, ram, disk, etc.) is emulated o e.g., QEMU o allows: | Application | | Solaris | | “emulation (e.g., of sparc)” | | OS (e.g., Linux) | | PC (e.g., intel) |
  • 9. Contents ➢a company and a platform ➢application-level virtualization ○ hw emulation ○ os virtualization ○ app containers ➢benefits ➢used technologies ➢usage ➢future
  • 10. Virtualization (VMs) virtualization with same hardware o e.g., VmWare, Virtualbox, Xen.. o allows: | Application | | Windows | | “virtualization engine” | | OS (e.g., Linux) | | PC (e.g., intel) |
  • 11. Contents ➢a company and a platform ➢application-level virtualization ○ hw emulation ○ os virtualization ○ app containers ➢benefits ➢used technologies ➢usage ➢future
  • 12. Containers an execution environment is virtualized o e.g., Solaris Zones, Linux LXC, Docker.. o allows: | Application | | Linux-ubuntu’s rootFS2 | | “Linux docker engine” | | Linux-centOS, rootFS1 | | PC (e.g., intel) | o Note: other app-level isolation:  virtualenv, ruby rvm, go gvm..
  • 13. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ➢used technologies ➢usage ➢future
  • 14. Why use Docker Some benefits of virtualizing applications are: 1. isolation 2. portability, shipping applications 3. specification of a complex system
  • 15. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ○ isolation ○ portability ○ specification ➢used technologies ➢usage ➢future
  • 16. Isolation ● set of minimal functions with fewer resources than VMs, o app isolated from other apps o app isolated from OS → protects OS and apps from bugs in one app o but without much performance loss ● secure sandboxes, o principle of least privilege ● (future) manage resource usage (limit, prio, measure)
  • 17. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ○ isolation ○ portability ○ specification ➢used technologies ➢usage ➢future
  • 18. Portability, Shipping Applications ❖ One App = ➢ binaries (exec, libs, etc.) ➢ data (assets, SQL DB, etc.) ➢ configs (/etc/config/files) ➢ logs either in a container or a composition
  • 19. Portability (2) Docker promise: Build, Ship, Run! ○ reliable deployments ○ develop here, run there
  • 21. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ○ isolation ○ portability ○ specification ➢used technologies ➢usage ➢future
  • 22. Specification of a complex system ● Developers use Version Control Systems (Mercurial, git) ● DevOps use VCS as well for docs and scripts o ascii docs, chef, puppet, ansible, salt stack, … o and… Dockerfiles! ● Docker allows to version-control complex specifications: o Dockerfile: how to build images o docker-compose.yml: how to orchestrate them
  • 23. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ➢used technologies ➢usage ➢future
  • 24. How does Docker work Used technologies: 1. lightweight virtualization 2. incremental images 3. Docker Hub: an image registry
  • 25. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ➢used technologies ○ lightweight virtualization ○ incremental images ○ images registry ➢usage ➢future
  • 26. Lightweight Virtualization ● Docker is based on Linux technologies o namespaces, cgroups, capabilities o driver = LXC o or now → driver = Libcontainer  a standard interface to making containers ● Benefits o low memory footprint o low disk footprint (see incremetal images after) o fast startup
  • 27. Lightweight Virtualization (2) ● High level: we have a “lightweight VM” o own process space o own network interface o can run as root o can have its own /sbin/init ● Low level: “chroot on steroids” o can also not have its own /sbin/init o share kernel with host o no device emulation
  • 28. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ➢used technologies ○ lightweight virtualization ○ incremental images ○ images registry ➢usage ➢future
  • 29. Incremental Images ● UnionFS o files from separate FS (branches) can be overlaid o forming a single coherent FS o branches may be read-only or read-write ● Docker Layers o each layer is mounted on top of prior layers o first layer = base image (scratch, busybox, ubuntu,..) o a read-only layer = an image o the top read-write layer = container
  • 30. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ➢used technologies ○ lightweight virtualization ○ incremental images ○ images registry ➢usage ➢future
  • 31. Docker Hub: an image registry ● part of the Docker ecosystem o makes it easy to publish, search, and run containers o private or public registries
  • 32. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ➢used technologies ➢usage ➢future
  • 33. How to build and run hello/Dockerfile $ cat Dockerfile FROM ubuntu ← on top of a “base image” RUN touch /hello ← each instruction is cached $ docker build -t hello . Step 0 : FROM ubuntu:14.04 ---> 9bd07e480c5b Step 1 : RUN touch /hello ---> Running in b8dd4e965482 ---> 164c3bf53715 Removing intermediate container b8dd4e965482 Successfully built 164c3bf53715 $ docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE hello latest 164c3bf53715 38 seconds ago 192.7 MB $ docker run -i -t hello /bin/bash ← specify a command to be run root@1a210c0a1846:/# ls -ls /hello 0 -rw-r--r-- 1 root root 0 May 18 14:31 /hello
  • 34. Dockerfiles (1) e.g., a jenkins slave: python2slave/Dockerfile FROM ubuntu:14.04 ← on top of a “base image” with tagged version specified RUN adduser --quiet jenkins RUN apt-get update && apt-get install -y python2.7 openssh-server RUN mkdir -p /var/run/sshd ← create a dir RUN apt-get install -y --no-install-recommends openjdk-7-jdk [...] RUN apt-get install -y python-argparse python-gdata python-pip RUN pip install --upgrade python-redmine COPY credentials/ /home/jenkins/credentials ← copy local data into the image RUN chown -R jenkins:jenkins /home/jenkins/credentials/ EXPOSE 22 ← open only one port CMD ["/usr/sbin/sshd", "-D"] ← finally run the app
  • 35. Dockerfiles (2) e.g., a nodejs serveur: docker_sinopia/Dockerfile FROM dockerfile/nodejs ← on top of a more complex “base image” MAINTAINER Keyvan Fatehi <keyvanfatehi@gmail.com> ← maintainer contact RUN adduser --disabled-password --gecos "" sinopia RUN mkdir -p /opt/sinopia/storage WORKDIR /opt/sinopia RUN npm install js-yaml sinopia RUN chown -R sinopia:sinopia /opt/sinopia USER sinopia ← sets the user id to use when running the image ADD /config_gen.js /opt/sinopia/config_gen.js ADD /start.sh /opt/sinopia/start.sh EXPOSE 4873 ← open only one port VOLUME /opt/sinopia ← make this directory accessible to other containers (or host) CMD ["/opt/sinopia/start.sh"] ← finally run the app
  • 36. from build and run → to pull and run ● reminder: an image can be stored in the Hub
  • 37. How to pull and run docker_sinopia [ (optional) $ docker pull keyvanfatehi/sinopia:latest ] $ docker run --name sinopia -d -p 4873:4873 keyvanfatehi/sinopia:latest $ docker logs -f sinopia edit config (launch an ubuntu image with app=vi): $ docker stop sinopia $ docker run --volumes-from sinopia -it --rm ubuntu vi /opt/sinopia/config.yaml $ docker start sinopia $ docker logs -f sinopia backup (find where a volume is located on the host) $ crontab -l 59 * * * 1-5 /usr/bin/rsync -av `docker inspect sinopia | egrep '/opt/sinopia.*/vfs/' | cut -d" -f4`/ /opt/sinopia >> /tmp/rsync.txt 2>&1 (Note: /opt/sinopia=/opt/docker/vfs/dir/6e20429fcad2e82be8b3…72d9a464ab8622b15)
  • 38. How to orchestrate docker_jenkins E.g., a jenkins master = a data container + a server container: $ docker run -v /var/jenkins_home --name=data busybox true $ docker build -t myjenkins . $ docker run -d -u root -p 8081:8080 -p 50001:50001 --volumes-from=data -- name=master myjenkins or: $ vi docker-compose.yml data: image: busybox volumes: - /var/jenkins_home master: build . ports: - 50001:50000 volumes_from: - data $ docker-compose up
  • 39. Contents ➢a company and a platform ➢application-level virtualization ➢benefits ➢used technologies ➢usage ➢future
  • 40. Where are we going ● Competing standards: e.g., rkt from CoreOS ● Docker: native clustering, security, hub, … o swarm: heterogeneous nodes, load balancing o security: capabilities, image signing o intranet “Docker Hubs” ● Where am I going: o use orchestration (e.g., docker-compose , Kubernetes) o use resource control (e.g., nofile limit) o docker-level monitoring o mixing Docker and Ansible
  • 41. Docker vs Configuration Tools Before use Ansible to ● setup hardware/VM, ● install packages, ● deploy code, ● run services. After use Ansible to ● setup hardware/VM, ● install Docker, ● run containers. use Dockerfiles to ● install packages, ● deploy code, ● run services.

Notes de l'éditeur

  1. Note: “Packer” is taking an other approach: input=ansible (or chef or shell) and output=container (or Vmware or Vbox) :)