+ All Categories
Home > Technology > Introduction Into Docker Ecosystem

Introduction Into Docker Ecosystem

Date post: 10-Feb-2017
Category:
Upload: alexander-pastukhov-ocpjp-ocpjwsd
View: 81 times
Download: 2 times
Share this document with a friend
43
Introduction into Docker Ecosystem Oleksandr Pastukhov JUG Shenzhen August 2016
Transcript
Page 1: Introduction Into Docker Ecosystem

Introduction into Docker Ecosystem

Oleksandr Pastukhov JUG Shenzhen August 2016

Page 2: Introduction Into Docker Ecosystem

Who am I? Senior Software developer in EPAM SZ Father and Husband. StartUp ideas generator. Could sell

any by 1$

Page 3: Introduction Into Docker Ecosystem

Docker as a Solution For Developer For Administrator Container vs VM Docker Basics Kitematic Docker in Numbers Orchestration Bonus

Agenda

Page 4: Introduction Into Docker Ecosystem

Docker as a Solution

Page 5: Introduction Into Docker Ecosystem

The Matrix From Hell

Static website

Web frontend

Background workers

User DB

Analytics DB

Queue

Development VM QA Server

Single Prod

ServerOnsite Cluster

Public Cloud

Contributor’s laptop

Customer Servers

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

Page 6: Introduction Into Docker Ecosystem

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

Also a matrix from hell

Page 7: Introduction Into Docker Ecosystem

Mul

tipl

icit

y of

Goo

dsM

ulti

pilic

ity

of m

etho

ds

for

tran

spor

ting

/sto

ring

Do I w

orry about how

goods interact (e.g. coff

ee beans next to

spices)

Can I transport quickly and sm

oothly(e.g. from

boat to train to

truck)

Cargo Transport Pre-1960

Page 8: Introduction Into Docker Ecosystem

Mul

tiplic

ity o

f Go

ods

Mul

tiplic

ity o

f m

etho

ds fo

r tra

nspo

rting

/sto

ring

Do I worry about how goods

interact (e.g. coffee beans

next to spices)

Can I transport quickly and sm

oothly(e.g. from

boat to train to truck)

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: Introduction Into Docker Ecosystem

Static website Web frontend User DB Queue Analytics DB

Development VM

QA server Public Cloud Contributor’s laptop

Docker is a shipping container system for code

Mul

tiplic

ity o

f St

acks

Mul

tiplic

ity o

f ha

rdwa

re

envi

ronm

ents

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…

Page 10: Introduction Into Docker Ecosystem

The Matrix From Hell

Static website

Web frontend

Background workers

User DB

Analytics DB

Queue

Development VM QA Server

Single Prod

ServerOnsite Cluster

Public Cloud

Contributor’s laptop

Customer Servers

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

Page 11: Introduction Into Docker Ecosystem

Static website

Web frontend

Background workers

User DB

Analytics DB

Queue

Development VM QA Server

Single Prod

ServerOnsite Cluster

Public Cloud

Contributor’s laptop

Customer Servers

Docker eliminates the matrix from Hell

Page 12: Introduction Into Docker Ecosystem

Build once…(finally) run anywhere◦ A clean, safe, hygienic and portable runtime environment for your app.◦ No worries about missing dependencies, packages and other pain points

during subsequent deployments.◦ Run each app in its own isolated container, so you can run various

versions of libraries and other dependencies for each app without worrying

◦ Automate testing, integration, packaging…anything you can script ◦ Reduce/eliminate concerns about compatibility on different platforms,

either your own or your customers. ◦ Cheap, zero-penalty containers to deploy services? A VM without the

overhead of a VM? Instant replay and reset of image snapshots? That’s the power of Docker

Why Developers Care

Page 13: Introduction Into Docker Ecosystem

Configure once... run anything Make the entire lifecycle more efficient, consistent, and repeatable Increase the quality of code produced by developers. Eliminate inconsistencies between development, test, production,

and customer environments. Support segregation of duties. Significantly improves the speed and reliability of continuous

deployment and continuous integration systems. Because the containers are so lightweight, address significant

performance, costs, deployment, and portability issues normally associated with VMs.

Why Administrators Care

Page 14: Introduction Into Docker Ecosystem

Containers vs. VMs

Page 15: Introduction Into Docker Ecosystem

AppA

Containers vs. VMs

Hypervisor (Type 2)Host OSServer

GuestOS

Bins/Libs

AppA’

GuestOS

Bins/Libs

AppB

GuestOS

Bins/Libs

App A’

Docker

Host OSServer

Bins/Libs

App ABins/Libs

App B

App B’

App B’

App B’VM

Container

Containers are isolated,but share OS and, whereappropriate, bins/libraries

GuestOS

GuestOS

…result is significantly faster deployment, much less overhead, easier migration, faster restart

Page 16: Introduction Into Docker Ecosystem

Why are Docker containers lightweight?

Bins/Libs

AppA

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

App Δ

Bins/

AppA

Bins/Libs

AppA’

GuestOS

Bins/Libs

Modified AppCopy on write capabilities allowus 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

AppA

GuestOS

Bins/Libs

Copy ofApp

No OS. CanShare bins/libs

AppA

GuestOS

GuestOS

VMs Containers

Page 17: Introduction Into Docker Ecosystem

What are the basics of the Docker system?

Source Code

Repository

DockerfileFor

A

Docker Engine

DockerContainer

Image Registry

Build

Docker

Host 2 OS (Linux)

Container A

Container B

Container C

Container A

Push

Search PullRun

Host 1 OS (Linux)

Page 18: Introduction Into Docker Ecosystem

Changes and Updates

Docker Engine

DockerContainer

Image Registry

Docker Engine

Push

Update

Bins/Libs

AppA

App Δ

Bins/

Base Container

Image

Host is now running A’’

Container Mod A’’

App Δ

Bins/

Bins/Libs

AppA

Bins/ Bins/Libs

AppA’’

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

Container Mod A’

Page 19: Introduction Into Docker Ecosystem
Page 20: Introduction Into Docker Ecosystem

Containers vs VMs?Better Together!

Page 21: Introduction Into Docker Ecosystem
Page 22: Introduction Into Docker Ecosystem

Docker Basics

Page 23: Introduction Into Docker Ecosystem
Page 24: Introduction Into Docker Ecosystem

Background Image

docker info - basic info about docker machinedocker stats - live stream containers statisticsdocker images - list imagesdocker ps - running containersdocker events - logs from docker machine

docker stop <containerid> - start containerdocker start <containerid>

kill | pause | unpause | restart

Commands

Page 25: Introduction Into Docker Ecosystem

Background Image

docker rm <containerid>docker rmi <imageid>

docker port <containerid> - mapped portsdocker inspect <containerid> - container infodocker top <containerid> - processesdocker exec <containerid> command -in the running containerdocker run <containerid> command -in the new container docker logs <containerid> - last logsdocker attach <containerid> - to see container logs realtime

Commands

Page 26: Introduction Into Docker Ecosystem

Background Image

docker build <dockerfile>docker search - in the hub for imagesdocker create <imgname>- new container from image docker export –o <filename> <containerid> – fs to tardocker import - fs from tardocker load <image >- image from tardocker save <image> - images to tardocker rename - container

Commands

Page 27: Introduction Into Docker Ecosystem

Background Image

Registrydocker login - to docker registrydocker logoutdocker commit - Create image from containerdocker diff - changes uncommitteddocker history - of changesdocker pull / push – image

docker cp - copy between containers

Commands

Page 28: Introduction Into Docker Ecosystem

Background Image

docker network connect disconnect inspect ls rm createvolume - manage volumes create

inspect ls rm

Commands

Page 29: Introduction Into Docker Ecosystem

Kitematic

Page 30: Introduction Into Docker Ecosystem
Page 31: Introduction Into Docker Ecosystem

Docker in Numbers

Page 32: Introduction Into Docker Ecosystem
Page 33: Introduction Into Docker Ecosystem
Page 34: Introduction Into Docker Ecosystem
Page 35: Introduction Into Docker Ecosystem
Page 36: Introduction Into Docker Ecosystem
Page 37: Introduction Into Docker Ecosystem
Page 38: Introduction Into Docker Ecosystem

Docker Ecosystem

Page 39: Introduction Into Docker Ecosystem
Page 40: Introduction Into Docker Ecosystem
Page 41: Introduction Into Docker Ecosystem

1. Docker under Raspberry Pi2. Set up a game server

Bonus

Page 42: Introduction Into Docker Ecosystem
Page 43: Introduction Into Docker Ecosystem

Questions?

http://altronica.comQuality Outsource


Recommended