docker 101 - high level introduction to docker

37
Dr Ganesh Neelakanta Iyer Technical Support Manager, Core products, Asia Pacific Progress

Upload: dr-ganesh-iyer

Post on 23-Jan-2018

112 views

Category:

Technology


5 download

TRANSCRIPT

Page 1: Docker 101 - High level introduction to docker

Dr Ganesh Neelakanta Iyer

Technical Support Manager, Core products, Asia Pacific

Progress

Page 2: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.2

Tech Support Manager at Progress, Hyderabad, India

Masters & Ph.D. from National University of Singapore

Interests: Kathakali, Traveling, Photography, Cooking

http://ganeshniyer.com

GANESHNIYER

About Me

Page 3: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.3

Agenda

Need for Docker/Container

Why containers matter?

Docker / Container vs Virtual Machine

Basics of Docker

Getting Started

Page 4: Docker 101 - High level introduction to docker

Lets go back to pre-1960’s

Page 5: Docker 101 - High level introduction to docker
Page 6: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.6

Multip

licity o

f

Goods

Mu

ltip

licity o

f

meth

ods f

or

transport

ing/s

toring

Do I w

orry

about

how

goods in

tera

ct

(e.g

. coffe

e b

eans

next to

spic

es)

Can I tra

nsport

quic

kly

and s

mooth

ly

(e.g

. from

boat to

train

to tru

ck)

Cargo Transport Pre-1960

Page 7: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.7

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

Also an M x N Matrix

Page 8: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.8

Multip

licity o

f

Goods

Multip

licity o

f

meth

ods f

or

transport

ing/s

toring

Do I w

orry

about

how

goods in

tera

ct

(e.g

. co

ffee b

eans

next to

spic

es)

Can I tra

nsport

quic

kly

and

sm

ooth

ly

(e.g

. from

boat to

train

to tru

ck)

Solution: Intermodal Shipping Container

…in between, can be loaded and

unloaded, stacked, transported

efficiently over long distances,

and transferred from one mode

of transport to another

A standard container that is

loaded with virtually any

goods, and stays sealed until

it reaches final delivery.

Page 9: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.9

This eliminated the M x N problem…

Page 10: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.10

and spawned an Intermodal Shipping Container Ecosystem

• 90% of all cargo now shipped in a standard container

• Order of magnitude reduction in cost and time to load and unload ships

• Massive reduction in losses due to theft or damage

• Huge reduction in freight cost as percent of final goods (from >25% to <3%) massive globalizations

• 5000 ships deliver 200M containers per year

Page 11: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.11

What is Docker?

Docker containers wrap a

piece of software in a

complete filesystem that

contains everything needed to

run: code, runtime, system

tools, system libraries –

anything that can be installed

on a server. This guarantees

that the software will always

run the same, regardless of

its environment.

[www.docker.com]http://altinvesthq.com/news/wp-content/uploads/2015/06/container-ship.jpg

Page 12: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.12

What is Docker?

Developers use Docker to eliminate “works on my machine” problems

when collaborating on code with co-workers.

Operators use Docker to run and manage apps side-by-side in

isolated containers to get better compute density.

Enterprises use Docker to build agile software delivery pipelines to

ship new features faster, more securely and with confidence for both

Linux and Windows Server apps.

[www.docker.com]

Page 13: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.13

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 o

f

Sta

cks

Multip

licity o

f

hard

ware

environ

ments

Production Cluster

Customer Data Center

Do s

erv

ices a

nd

apps in

tera

ct

appro

pria

tely

?

Can I m

igra

te

sm

ooth

ly a

nd

quic

kly

?

Page 14: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.14

Results in M x N compatibility nightmare

Static website

Web frontend

Background workers

User DB

Analytics DB

Queue

Development

VMQA Server

Single Prod

Server

Onsite

ClusterPublic Cloud

Contributor’s

laptop

Customer

Servers

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

Page 15: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.15

Static website Web frontend User DB Queue Analytics DB

Development

VMQA server Public Cloud Contributor’s

laptop

Docker is a shipping container system for code M

ultip

licity o

f

Sta

cks

Multip

licity o

f

hard

ware

environ

ments

Production

ClusterCustomer Data

Center

Do s

erv

ices a

nd

apps in

tera

ct

appro

pria

tely

?

Can I m

igra

te

sm

ooth

ly a

nd

quic

kly

…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…

Page 16: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.16

Static website Web frontend User DB Queue Analytics DB

Development

VMQA server Public Cloud Contributor’s

laptop

Or…put more simplyM

ultip

licity o

f

Sta

cks

Multip

licity o

f

hard

ware

environ

ments

Production

ClusterCustomer Data

Center

Do s

erv

ices a

nd

apps in

tera

ct

appro

pria

tely

?

Can I m

igra

te

sm

ooth

ly a

nd

quic

kly

Operator: Configure Once, Run

Anything

Developer: Build Once, Run

Anywhere (Finally)

Page 17: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.17

Static website

Web frontend

Background workers

User DB

Analytics DB

Queue

Development

VMQA Server

Single Prod

Server

Onsite

ClusterPublic Cloud

Contributor’s

laptop

Customer

Servers

Docker solves the M x N problem

Page 18: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.18

Docker containers

Wrap up a piece of software in a complete file system

that contains everything it needs to run:

• Code, runtime, system tools, system libraries

• Anything you can install on a server

This guarantees that it will always run the same,

regardless of the environment it is running in

Page 19: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.19

Why containers matter

Physical Containers Docker

Content Agnostic The same container can hold almost

any type of cargo

Can encapsulate any payload and its

dependencies

Hardware Agnostic Standard shape and interface allow

same container to move from ship to

train to semi-truck to warehouse to

crane without being modified or

opened

Using operating system primitives (e.g.

LXC) can run consistently on virtually

any hardware—VMs, bare metal,

openstack, public IAAS, etc.—without

modification

Content Isolation and

Interaction

No worry about anvils crushing

bananas. Containers can be stacked

and shipped together

Resource, network, and content

isolation. Avoids dependency hell

Automation Standard interfaces make it easy to

automate loading, unloading, moving,

etc.

Standard operations to run, start, stop,

commit, search, etc. Perfect for devops:

CI, CD, autoscaling, hybrid clouds

Highly efficient No opening or modification, quick to

move between waypoints

Lightweight, virtually no perf or start-up

penalty, quick to move and manipulate

Separation of duties Shipper worries about inside of box,

carrier worries about outside of box

Developer worries about code. Ops

worries about infrastructure.

Page 20: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.20

Docker containers

Lightweight

• Containers running on one machine all share the same OS kernel

• They start instantly and make more efficient use of RAM

• Images are constructed from layered file systems

• They can share common files, making disk usage and image downloads much more efficient

Open

• Based on open standards

• Allowing containers to run on all major Linux distributions and Microsoft OS with support for every infrastructure

Secure

• Containers isolate applications from each other and the underlying infrastructure while providing an added layer of protection for the application

Page 21: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.21

Docker / Containers vs. Virtual Machine

https://www.docker.com/whatisdocker/

Containers have similar resource

isolation and allocation benefits as

VMs but a different architectural

approach allows them to be much

more portable and efficient

Page 22: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.22

Docker / Containers vs. Virtual Machine

https://www.docker.com/whatisdocker/

• Each virtual machine includes the application,

the necessary binaries and libraries and an

entire guest operating system - all of which

may be tens of GBs in size

• It includes the application and all of its

dependencies, but share the kernel with other

containers.

• They run as an isolated process in userspace

on the host operating system.

• Docker containers run on any computer, on

any infrastructure and in any cloud

Page 23: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.23

Why are Docker containers lightweight?

Bins/

Libs

App

A

Original App(No OS to takeup space, resources,or require restart)

App Δ

Bin

s

/

App

A

Bins/

Libs

App

A’

Gues

t

OS

Bins/

Libs

Modified App

Union file system allowsus to only save the diffsBetween container A and containerA’

VMsEvery app, every copy of anapp, and every slight modificationof the app requires a new virtual server

App

A

Guest

OS

Bins/

Libs

Copy ofApp

No OS. CanShare bins/libs

App

A

Guest

OS

Guest

OS

VMs Containers

Page 24: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.24

What are the basics of the Docker system?

Source

Code

Repository

Dockerfile

For

A

Docker Engine

Docker

Container

Image

Registry

Build

Docker Engine

Host 2 OS 2 (Windows / Linux)

Conta

iner

A

Conta

iner

B

Conta

iner

C

Conta

iner A

Push

SearchPull

Run

Host 1 OS (Linux)

Page 25: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.25

Changes and Updates

Docker Engine

Docker

Container

Image

Registry

Docker Engine

Push

Update

Bins/

Libs

App

A

App Δ

Bin

s

/

Base Container

Image

Host is now running A’’

Container Mod A’’

App Δ

Bin

s

/

Bins/

Libs

App

A

Bin

s

/ Bins/

Libs

App

A’’

Host running A wants to upgrade to A’’. Requests update. Gets only diffs

Container Mod A’

Page 26: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.26

Easily Share and Collaborate on Applications

Distribute and share content

• Store, distribute and manage your Docker images in your Docker

Hub with your team

• Image updates, changes and history are automatically shared

across your organization.

Simply share your application with others

• Ship your containers to others without worrying about different

environment dependencies creating issues with your application.

• Other teams can easily link to or test against your app without

having to learn or worry about how it works.

Docker creates a common framework for developers and sysadmins to work

together on distributed applications

Page 27: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.27

Get Started with Docker

Install Docker

Run a software image in a container

Browse for an image on Docker Hub

Create your own image and run it in a container

Create a Docker Hub account and an image repository

Create an image of your own

Push your image to Docker Hub for others to use

https://www.docker.com/products/docker

https://www.docker.com/products/docker-toolbox

Page 28: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.28

Docker Container as a Service (CaaS)

Deliver an IT secured and managed application environment for developers

to build and deploy applications in a self service manner

Page 29: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.29

Typical Use cases

Page 30: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.30

App Modernization

Page 31: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.31

Continuous Integration and Deployment (CI / CD)

The modern development pipeline is fast, continuous and automated with the goal of

more reliable software

CI/CD allows teams to integrate new code as often as every time code is checked in by

developers and passes testing

A cornerstone of devops methodology, CI/CD creates a real time feedback loop with a

constant stream of small iterative changes that accelerates change and improves

quality

CI environments are often fully automated to trigger a test at git push and to

automatically build a new image if the test is successful and push to a Docker Registry

Further automation and scripting can deploy a container from the new image to staging

for further testing.

Page 32: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.32

Microservices

App architecture is changing from monolithic code bases with waterfall

development methodologies to loosely coupled services that are

developed and deployed independently

Tens to thousands of these services can be connected to form an app

Docker allows developers are able to choose the best tool or stack for

each service and isolates them to eliminate any potential conflicts and

avoids the “matrix from hell.”

These containers can be easily shared, deployed, updated and scaled

instantly and independently of the other services that make up the app

Docker’s end to end security features allow teams to build and operate a

least privilege microservices model where services only get access to the

resources (other apps, secrets, compute) they need to run at just the

right time to create.

Page 33: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.33

IT Infrastructure optimization

Docker and containers help optimize the utilization and cost

of your IT infrastructure

Optimization not just cost reduction, it is ensuring the right

amount of resources are available at the right time and

used efficiently

Because containers are lightweight ways of packaging and

isolating app workloads, Docker allows multiple workloads

to run on the same physical or virtual server without conflict

Businesses can consolidate datacenters, integrate IT from

mergers and acquisitions and enable portability to cloud

while reducing the footprint of operating systems and

servers to maintain

Page 34: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.34

Hybrid Cloud

Docker guarantees apps are cloud enabled - ready

to move across private and public clouds with a

higher level of control and guarantee apps will

operate as designed

The Docker platform is infrastructure independent

and ensures everything the app needs to run is

packaged and transported together from one site to

another

Docker uniquely provides flexibility and choice for

businesses to adopt a single, multi or hybrid cloud

environment without conflict

Page 35: Docker 101 - High level introduction to docker

© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.35

How does this help you build better software?

• Stop wasting hours trying to setup developer environments

• Spin up new instances and make copies of production code to run locally

• With Docker, you can easily take copies of your live environment and run on any new endpoint running Docker.

Accelerate Developer Onboarding

• The isolation capabilities of Docker containers free developers from the worries of using “approved” language stacks and tooling

• Developers can use the best language and tools for their application service without worrying about causing conflict issues

Empower Developer Creativity

• By packaging up the application with its configs and dependencies together and shipping as a container, the application will always work as designed locally, on another machine, in test or production

• No more worries about having to install the same configs into a different environment

Eliminate Environment Inconsistencies

Page 36: Docker 101 - High level introduction to docker