Slide 1

Slide 1 text

Docker From basics to orchestration

Slide 2

Slide 2 text

Credits Special thanks to all the people who made and released these awesome resources for free: ◎ Presentation template by SlidesCarnival ◎ Photographs by Unsplash & Death to the Stock Photo (license) ◎ Dark wood background by The pattern library

Slide 3

Slide 3 text

About Me

Slide 4

Slide 4 text

Overview

Slide 5

Slide 5 text

Overview ◎ Environment Issues ◎ Virtualization ◎ LXC ◎ Docker ○ features ○ demo ◎ Machine ◎ Orchestration ○ tools ○ demo ◎ Swarm ○ demo ◎ Q&A

Slide 6

Slide 6 text

Environment Issues

Slide 7

Slide 7 text

Environment Issues ◎ substr vs mb_substr functions

Slide 8

Slide 8 text

Environment Issues ◎ substr vs mb_substr functions ◎ short open tags:

Slide 9

Slide 9 text

Environment Issues ◎ substr vs mb_substr functions ◎ short open tags:

Slide 10

Slide 10 text

Environment Issues ◎ substr vs mb_substr functions ◎ short open tags:

Slide 11

Slide 11 text

Environment Issues ◎ substr vs mb_substr functions ◎ short open tags:

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Virtualization

Slide 15

Slide 15 text

◎ 1960 - inspired by cpu time sharing Virtualization - History

Slide 16

Slide 16 text

◎ 1960 - inspired by cpu time sharing ◎ IBM 370 - First instructions to support software virtualization, CP/CMS allow running more than one instance simultaneously Virtualization - History

Slide 17

Slide 17 text

◎ 1960 - inspired by cpu time sharing ◎ IBM 370 - First instructions to support software virtualization, CP/CMS allow running more than one instance simultaneously ◎ IBM z/VM - First success case, all hardware were virtualized Virtualization - History

Slide 18

Slide 18 text

◎ 1960 - inspired by cpu time sharing ◎ IBM 370 - First instructions to support software virtualization, CP/CMS allow running more than one instance simultaneously ◎ IBM z/VM - First success case, all hardware were virtualized ◎ until nineties only client/server applications Virtualization - History

Slide 19

Slide 19 text

◎ 1960 - inspired by cpu time sharing ◎ IBM 370 - First instructions to support software virtualization, CP/CMS allow running more than one instance simultaneously ◎ IBM z/VM - First success case, all hardware were virtualized ◎ until nineties only client/server applications ◎ 2000+ - CPUs with virtualization support, hypervisors: VMWare, Xen, KVM, VirtualBox, etc Virtualization - History

Slide 20

Slide 20 text

Virtualization - Hypervisors

Slide 21

Slide 21 text

Virtualization - Stack

Slide 22

Slide 22 text

◎ Standard environment Virtualization - Pros & Cons

Slide 23

Slide 23 text

◎ Standard environment ◎ Improve resources utilization Virtualization - Pros & Cons

Slide 24

Slide 24 text

◎ Standard environment ◎ Improve resources utilization ◎ Easy data recovery Virtualization - Pros & Cons

Slide 25

Slide 25 text

◎ Standard environment ◎ Improve resources utilization ◎ Easy data recovery ◎ If host fails all VMs crashes together Virtualization - Pros & Cons

Slide 26

Slide 26 text

◎ Standard environment ◎ Improve resources utilization ◎ Easy data recovery Virtualization - Pros & Cons ◎ If host fails all VMs crashes together ◎ Troubleshooting more difficult

Slide 27

Slide 27 text

◎ Standard environment ◎ Improve resources utilization ◎ Easy data recovery Virtualization - Pros & Cons ◎ If host fails all VMs crashes together ◎ Troubleshooting more difficult ◎ Increase overhead

Slide 28

Slide 28 text

LXC - Linux Containers

Slide 29

Slide 29 text

LXC - Linux Containers ◎ Exists since Jul/2008 - Kernel 2.6.26+

Slide 30

Slide 30 text

LXC - Linux Containers ◎ Exists since Jul/2008 - Kernel 2.6.26+ ◎ Process isolation

Slide 31

Slide 31 text

LXC - Linux Containers ◎ Exists since Jul/2008 - Kernel 2.6.26+ ◎ Process isolation ◎ Network isolation

Slide 32

Slide 32 text

LXC - Linux Containers ◎ Exists since Jul/2008 - Kernel 2.6.26+ ◎ Process isolation ◎ Network isolation ◎ Memory limitation

Slide 33

Slide 33 text

LXC - Linux Containers ◎ Exists since Jul/2008 - Kernel 2.6.26+ ◎ Process isolation ◎ Network isolation ◎ Memory limitation ◎ File system isolation

Slide 34

Slide 34 text

LXC - Pros & Cons ◎ Good resources isolation

Slide 35

Slide 35 text

LXC - Pros & Cons ◎ Good resources isolation ◎ Run as a process, a single PID is created

Slide 36

Slide 36 text

LXC - Pros & Cons ◎ Good resources isolation ◎ Run as a process, a single PID is created ◎ Reuse host resources (libs, kernel)

Slide 37

Slide 37 text

LXC - Pros & Cons ◎ Good resources isolation ◎ Run as a process, a single PID is created ◎ Reuse host resources (libs, kernel) ◎ Starts much more faster than VMs

Slide 38

Slide 38 text

LXC - Pros & Cons ◎ Volume share are difficult to do ◎ Good resources isolation ◎ Run as a process, a single PID is created ◎ Reuse host resources (libs, kernel) ◎ Starts much more faster than VMs

Slide 39

Slide 39 text

LXC - Pros & Cons ◎ Volume share are difficult to do ◎ Architecture failure may lead to chroot attack ◎ Good resources isolation ◎ Run as a process, a single PID is created ◎ Reuse host resources (libs, kernel) ◎ Starts much more faster than VMs

Slide 40

Slide 40 text

LXC - Pros & Cons ◎ Volume share are difficult to do ◎ Architecture failure may lead to chroot attack ◎ IO overhead ◎ Good resources isolation ◎ Run as a process, a single PID is created ◎ Reuse host resources (libs, kernel) ◎ Starts much more faster than VMs

Slide 41

Slide 41 text

LXC - Pros & Cons ◎ Volume share are difficult to do ◎ Architecture failure may lead to chroot attack ◎ IO overhead ◎ Run on Linux hosts only ◎ Good resources isolation ◎ Run as a process, a single PID is created ◎ Reuse host resources (libs, kernel) ◎ Starts much more faster than VMs

Slide 42

Slide 42 text

DOCKER

Slide 43

Slide 43 text

Docker

Slide 44

Slide 44 text

Docker Doki =>

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

◎ Portable Docker - Features

Slide 49

Slide 49 text

◎ Portable ◎ Versionable Docker - Features

Slide 50

Slide 50 text

◎ Portable ◎ Versionable ◎ Reusable Docker - Features

Slide 51

Slide 51 text

◎ Portable ◎ Versionable ◎ Reusable ◎ Copy-on-write Docker - Features

Slide 52

Slide 52 text

◎ Portable ◎ Versionable ◎ Reusable ◎ Copy-on-write ◎ Logging Docker - Features

Slide 53

Slide 53 text

◎ Portable ◎ Versionable ◎ Reusable ◎ Copy-on-write ◎ Logging ◎ Image change management Docker - Features

Slide 54

Slide 54 text

◎ Portable ◎ Versionable ◎ Reusable ◎ Copy-on-write ◎ Logging ◎ Image change management ◎ Automatic build Docker - Features

Slide 55

Slide 55 text

◎ Portable ◎ Versionable ◎ Reusable ◎ Copy-on-write ◎ Logging ◎ Image change management ◎ Automatic build ◎ Easy to share Docker - Features

Slide 56

Slide 56 text

Docker - Features ◎ Private and public registry

Slide 57

Slide 57 text

Docker - Features ◎ Private and public registry ◎ Server-client architecture

Slide 58

Slide 58 text

Docker - Features ◎ Private and public registry ◎ Server-client architecture ◎ Client consume engine API

Slide 59

Slide 59 text

Docker - Features ◎ Private and public registry ◎ Server-client architecture ◎ Client consume engine API ◎ Orchestration tools (compose, swarm,volume networks)

Slide 60

Slide 60 text

Docker - Features ◎ Private and public registry ◎ Server-client architecture ◎ Client consume engine API ◎ Orchestration tools (compose, swarm,volume networks) ◎ Always innovating

Slide 61

Slide 61 text

Docker - VM Comparison

Slide 62

Slide 62 text

Docker - Quick Tips ◎ It is a container not a VM

Slide 63

Slide 63 text

Docker - Quick Tips ◎ It is a container not a VM ◎ Container images are like VM boxes

Slide 64

Slide 64 text

Docker - Quick Tips ◎ It is a container not a VM ◎ Container images are like VM boxes ◎ Images are state, container runs it

Slide 65

Slide 65 text

Docker - Install ◎ Follow instructions for your OS in http://docs. docker.com/installation

Slide 66

Slide 66 text

Docker - Install ◎ Follow instructions for your OS in http://docs. docker.com/installation ◎ Several distros supported

Slide 67

Slide 67 text

Docker - Install ◎ Follow instructions for your OS in http://docs. docker.com/installation ◎ Several distros supported ◎ Mac OS X and Windows needs a VM to act like a Docker host - Boot2docker

Slide 68

Slide 68 text

Docker - Install ◎ Follow instructions for your OS in http://docs. docker.com/installation ◎ Several distros supported ◎ Mac OS X and Windows needs a VM to act like a Docker host - Boot2docker ◎ There is roadmap to run Linux container on FreeBSD host

Slide 69

Slide 69 text

Docker - Install ◎ Follow instructions for your OS in http://docs. docker.com/installation ◎ Several distros supported ◎ Mac OS X and Windows needs a VM to act like a Docker host - Boot2docker ◎ There is roadmap to run Linux container on FreeBSD host ◎ Windows containers running on Windows hosts will be available on Windows Server 2016

Slide 70

Slide 70 text

Docker - Beggining ◎ run ◎ pull ◎ commit ◎ push ◎ exec ◎ ps ◎ images ◎ inspect ◎ rm ◎ rmi

Slide 71

Slide 71 text

“ Talk is cheap, show me the code. Linus Torvalds “

Slide 72

Slide 72 text

pull commit push Docker - Images Dockerfile

Slide 73

Slide 73 text

Docker - Improving ◎ Volume ○ list, create, inspect ◎ Port expose and port mapping ◎ Links between containers ◎ Network ○ list, create,inspect, connect

Slide 74

Slide 74 text

Second Demo

Slide 75

Slide 75 text

Docker - Machine ◎ Creates virtual machines ready to run docker locally or on the cloud. ◎ drivers available: ○ Amazon Web Services, Microsoft Azure, Digital Ocean, Exoscale, Google Compute Engine, Microsoft Hyper-V, OpenStack, Rackspace, IBM Softlayer, Oracle VirtualBox, VMware vCloud Air, VMware Fusion, VMware vSphere and Generic

Slide 76

Slide 76 text

Docker - Orchestration ◎ Docker Compose (Old FIG)

Slide 77

Slide 77 text

Docker - Orchestration ◎ Docker Compose (Old FIG)

Slide 78

Slide 78 text

Docker - Orchestration ◎ Docker Compose (Old FIG)

Slide 79

Slide 79 text

Docker - Orchestration ◎ Docker Compose (Old FIG) ○ Config file: docker-compose.yml ○ Run: docker-compose up

Slide 80

Slide 80 text

Docker - Orchestration ◎ Docker Compose (Old FIG) ○ Config file: docker-compose.yml ○ Run: docker-compose up ◎ Crane - http://getcrane.com ○ Config file: crane.json or crane.yaml ○ Run: crane lift

Slide 81

Slide 81 text

Docker - Orchestration ◎ Docker Compose (Old FIG) ○ Config file: docker-compose.yml ○ Run: docker-compose up ◎ Crane - http://getcrane.com ○ Config file: crane.json or crane.yaml ○ Run: crane lift ◎ AZK - http://www.azk.io ○ Config file: Azkfile.js ○ Run: `azk agent start` and then `azk start`

Slide 82

Slide 82 text

Third Demo

Slide 83

Slide 83 text

Docker - Orchestration ◎ Docker Swarm ○ Orchestrate docker hosts ○ supports schedulers and node discovery services

Slide 84

Slide 84 text

Last Demo

Slide 85

Slide 85 text

Docker - Comming ◎ User namespaces ◎ Open Containers Initiative - by Linux Foundation: https://www.opencontainers.org/

Slide 86

Slide 86 text

Voucher: php_conf2015 Q&A Slides http://bit.ly/phpconfbr2015