Docker, a new LINUX container technology based light weight virtualization
-
Upload
suresh-balla -
Category
Presentations & Public Speaking
-
view
1.128 -
download
1
description
Transcript of Docker, a new LINUX container technology based light weight virtualization
![Page 1: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/1.jpg)
www.unicomlearning.com
Emerging Technology Emerging Technology Summit 2014Summit 2014
www.cloudandmobility.org
26 Sept, 2014 - Bangalore26 Sept, 2014 - Bangalore
DockerDocker
Suresh BallaSuresh Balla
Principal ConsultantPrincipal Consultant
Neudesic, IndiaNeudesic, India
![Page 2: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/2.jpg)
www.unicomlearning.comAgenda
UNICOM PresentsUNICOM Presents
Emerging Technology Emerging Technology Summit-2014Summit-2014
What?Why?How?Ecosystem?
![Page 3: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/3.jpg)
What is a Docker?
Build, Ship and Run Any App, Anywhere
Lightweight Virtualized Environments
![Page 4: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/4.jpg)
Static website
Web frontend
User DB
Queue Analytics DB
Background workers
API endpoint
nginx 1.5 + modsecurity + openssl + bootstrap 2
postgresql + pgv8 + v8
hadoop + hive + thrift + OpenJDK
Ruby + Rails + sass + Unicorn
Redis + redis-sentinel
Python 3.0 + celery + pyredis + libcurl + ffmpeg + libopencv + nodejs + phantomjs
Python 2.7 + Flask + pyredis + celery + psycopg + postgresql-client
Development VM
QA server
Public Cloud
Disaster recovery
Contributor’s laptop
Production Servers
The ChallengeM
ultip
licity
of
Stac
ksM
ultip
licity
of
hard
war
e en
viro
nmen
ts Production Cluster
Customer Data Center
Do services and apps interact
appropriately?
Can I migrate
smoothly and quickly?
Slide Reference: DockerCon
![Page 5: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/5.jpg)
Static website Web frontend User DB Queue Analytics DB
Development VM
QA server Public Cloud Contributor’s laptop
Docker containers to rescue M
ultip
licity
of S
tack
sM
ultip
licity
of
hard
war
e en
viro
nmen
ts
Production Cluster
Customer Data Center
Do services and apps interact
appropriately?
Can I migrate
smoothly and quickly
…that can be manipulated using standard operations and run consistently on virtually any hardware platform
An engine that enables any payload to be encapsulated as a lightweight, portable, self-sufficient container…
Slide Reference: DockerCon
![Page 6: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/6.jpg)
VMs vs Bare Containers vs Docker
Hardware
Operating System
Type 2 Hypervisor
Virtual Machine
Operating System
Bins / libs
App App
Virtual Machine
Operating System
Bins / libs
App App
Hardware
Type 1 Hypervisor
Virtual Machine
Operating System
Bins / libs
App App
Virtual Machine
Operating System
Bins / libs
App App
Hardware
Operating System
Container
Bins / libs
App App
Container
Bins / libs
App App
![Page 7: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/7.jpg)
VMs vs Bare Containers vs Docker
Hardware
Operating System
Type 2 Hypervisor
Virtual Machine
Operating System
Bins / libs
App App
Virtual Machine
Operating System
Bins / libs
App App
Hardware
Type 1 Hypervisor
Virtual Machine
Operating System
Bins / libs
App App
Virtual Machine
Operating System
Bins / libs
App App
Hardware
Operating System
ContainerBins / libs
App App
Container
Bins / libs
App App
![Page 8: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/8.jpg)
Docker Workflow
Source Code Repository
Dockerfile
For A
Docker Engine
DockerContainer
Image Registry
Build
Docker
Host 2 OS (Linux)
Container A
Container B
Container C
Container A
Push
Search Pull
Run
Host 1 OS (Linux)
Slide Reference: DockerCon
![Page 9: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/9.jpg)
Docker Architecture• Client Server Architecture
– Sockets or RESTfull API
• Docker Deamon• Docker client• Images – a read-only
templates• Registries - holds images• Container – created from an
image
![Page 10: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/10.jpg)
sudo docker run -i -t ubuntu /bin/bash
• Pulls the ubuntu image• Creates a new container• Allocates a filesystem and mounts a read-write layer• Allocates a network / bridge interface• Sets up an IP address• Executes a process that you specify• Captures and provides application output
![Page 11: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/11.jpg)
Docker CLI• docker search• docker pull• docker run• docker commit• docker inspect• docker push• docker images
![Page 12: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/12.jpg)
Demo
![Page 13: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/13.jpg)
Setup• On your servers (LINUX)
– Packages (Ubuntu, Debian, Fedora etc.)– Single Binary install – Easy provisioning on Rackspace, Digital Ocean, AWS – EC2, GCE,
Windows Azure• On your dev environment
– Vagrant Up– Boot2docker (25 MB VM image)– Natively (If you run Linux)
Linux Kernel 3.8
![Page 14: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/14.jpg)
Technologies
• Go Lang• Open Sourced by DotCloud March
2013• Libcontainer - cgroups, namespaces
– LXC as default environments in versions < 0.9
![Page 15: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/15.jpg)
Authoring Images with Dockerfile# DOCKER-VERSION 0.10.0
# Pull base image.FROM ubuntu:14.04
# Install Node.jsRUN apt-get updateRUN apt-get install -y software-properties-commonRUN add-apt-repository -y ppa:chris-lea/node.jsRUN apt-get updateRUN apt-get install -y nodejsRUN apt-get install -y supervisorRUN mkdir -p /var/log/supervisor
ADD . /src
# add the supervisor config file to default location that it would look forADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN cd /src; npm install
ENV PORT 3001ENV NODE_ENV development
EXPOSE 3001
CMD ["node", "/src/server.js"]
![Page 16: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/16.jpg)
Demo
![Page 17: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/17.jpg)
One Process per Container
Only one process per container
Use supervisor process to launch multiple child process inside the container
![Page 18: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/18.jpg)
Docker Hub• SaaS offerings - Public and private repositories
• Need your own private registry?– https://github.com/docker/docker-registry– Also a Docker container
![Page 19: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/19.jpg)
Automated Builds
GitHub and BitBucket Integrations
Web Hooks
Build Triggers
![Page 20: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/20.jpg)
Demo
![Page 21: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/21.jpg)
Ecosystem• Cocaine, Dein, Flynn – Private PaaS• CoreOS, full distro based on Docker – Linux Distribution• Red Hat’s Project Atomic - Linux Distribution• Google’s Kubernetes – container management• New Relic Centurian – container management• OpenStack Integration (In Havana, Nova has Docker driver)• Vagrant – Docker provider
![Page 22: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/22.jpg)
Related Open Source LibrariesGo lang based•libcontainer•libchan•libswarm
![Page 23: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/23.jpg)
Use Cases• Cloud9 IDE• eBay• mailGun/Rackspace• CloudFlare• Cambridge Health Care• Red Hat Openshift
![Page 24: Docker, a new LINUX container technology based light weight virtualization](https://reader035.fdocuments.us/reader035/viewer/2022062300/55649757d8b42ab8278b4c03/html5/thumbnails/24.jpg)
www.unicomlearning.com
Emerging Technology Emerging Technology Summit-2014Summit-2014
Organized byOrganized byUNICOM Trainings & Seminars Pvt. Ltd. UNICOM Trainings & Seminars Pvt. Ltd.
[email protected]@unicomlearning.com
Suresh BallaSuresh [email protected]@Neudesic.com
www.cloudandmobility.org