SlideShare una empresa de Scribd logo
1 de 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/

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Similar a 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
 

Similar a 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
 

Último

tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
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...panagenda
 
+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
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 

Último (20)

tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
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...
 
+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...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 

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.

Notas del editor

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