docker, a new linux container technology based light weight virtualization

Post on 26-May-2015

1.134 Views

Category:

Presentations & Public Speaking

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

An Intro to Docker

TRANSCRIPT

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

www.unicomlearning.comAgenda

UNICOM PresentsUNICOM Presents

Emerging Technology Emerging Technology Summit-2014Summit-2014

What?Why?How?Ecosystem?

What is a Docker?

Build, Ship and Run Any App, Anywhere

Lightweight Virtualized Environments

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

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

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

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

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

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

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

Docker CLI• docker search• docker pull• docker run• docker commit• docker inspect• docker push• docker images

Demo

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

Technologies

• Go Lang• Open Sourced by DotCloud March

2013• Libcontainer - cgroups, namespaces

– LXC as default environments in versions < 0.9

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"]

Demo

One Process per Container

Only one process per container

Use supervisor process to launch multiple child process inside the container

Docker Hub• SaaS offerings - Public and private repositories

• Need your own private registry?– https://github.com/docker/docker-registry– Also a Docker container

Automated Builds

GitHub and BitBucket Integrations

Web Hooks

Build Triggers

Demo

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

Related Open Source LibrariesGo lang based•libcontainer•libchan•libswarm

Use Cases• Cloud9 IDE• eBay• mailGun/Rackspace• CloudFlare• Cambridge Health Care• Red Hat Openshift

www.unicomlearning.com

Emerging Technology Emerging Technology Summit-2014Summit-2014

Organized byOrganized byUNICOM Trainings & Seminars Pvt. Ltd. UNICOM Trainings & Seminars Pvt. Ltd.

contact@unicomlearning.comcontact@unicomlearning.com

Suresh BallaSuresh BallaSuresh.Balla@Neudesic.comSuresh.Balla@Neudesic.com

www.cloudandmobility.org

top related