Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

asm89 / @iam_asm89

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Dependencies

Slide 6

Slide 6 text

?

Slide 7

Slide 7 text

?

Slide 8

Slide 8 text

?

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Deployment

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

Linux containers Run everywhere

Slide 22

Slide 22 text

Linux containers Run everything

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

What is a linux container?

Slide 25

Slide 25 text

Lightweight VM ● Own process space ● Own network interface ● Can run stuff as root ● Can have its own /sbin/init “machine container”

Slide 26

Slide 26 text

Lightweight VM ● Own process space ● Own network interface ● Can run stuff as root ● Can have its own /sbin/init “machine container” ● Not having its own /sbin/init ● Isolated processes ● Share kernel with the host “application container” Chroot on steroids

Slide 27

Slide 27 text

VM vs Container

Slide 28

Slide 28 text

$ ps aux | wc -l 174 $ docker run -it ubuntu bash root@86f8213d57e0:/# ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 4.0 0.0 18152 1856 ? Ss 23:05 0:00 bash root 9 0.0 0.0 15568 1148 ? R+ 23:05 0:00 ps aux

Slide 29

Slide 29 text

Docker 101

Slide 30

Slide 30 text

$ sudo apt-get update $ sudo apt-get install docker.io $ sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker

Slide 31

Slide 31 text

$ docker pull ubuntu

Slide 32

Slide 32 text

$ docker images | grep ubuntu ubuntu 13.10 5e019ab7bf6d 3 weeks ago 180 MB ubuntu saucy 5e019ab7bf6d 3 weeks ago 180 MB ubuntu precise 74fe38d11401 3 weeks ago 209.4 MB ubuntu 12.04 74fe38d11401 3 weeks ago 209.4 MB ubuntu 12.10 a7cf8ae4e998 3 weeks ago 171.2 MB ubuntu quantal a7cf8ae4e998 3 weeks ago 171.2 MB ubuntu 14.04 99ec81b80c55 3 weeks ago 266 MB ...

Slide 33

Slide 33 text

$ docker run ubuntu echo “hello world” hello world

Slide 34

Slide 34 text

Demo

Slide 35

Slide 35 text

$ docker run -d ubuntu ping 127.0.0.1

Slide 36

Slide 36 text

$ docker run -d ubuntu ping 127.0.0.1 $ docker ps

Slide 37

Slide 37 text

$ docker run -d ubuntu ping 127.0.0.1 $ docker ps $ docker attach

Slide 38

Slide 38 text

$ docker run -d ubuntu ping 127.0.0.1 $ docker ps $ docker attach $ docker stop/start/restart

Slide 39

Slide 39 text

Demo

Slide 40

Slide 40 text

$ docker run ubuntu rm /etc/passwd

Slide 41

Slide 41 text

$ docker run ubuntu rm /etc/passwd $ docker run ubuntu cat /etc/passwd root:x:0:0:root:/root:/bin/bash …

Slide 42

Slide 42 text

$ docker run ubuntu rm /etc/passwd $ docker run ubuntu cat /etc/passwd root:x:0:0:root:/root:/bin/bash … $ docker ps -n=2

Slide 43

Slide 43 text

$ docker run ubuntu rm /etc/passwd $ docker run ubuntu cat /etc/passwd root:x:0:0:root:/root:/bin/bash … $ docker ps -n=2 $ docker commit borked-ubuntu

Slide 44

Slide 44 text

$ docker run ubuntu rm /etc/passwd $ docker run ubuntu cat /etc/passwd root:x:0:0:root:/root:/bin/bash … $ docker ps -n=2 $ docker commit borked-ubuntu $ docker run borked-ubuntu cat /etc/passwd cat: /etc/passwd: No such file or directory

Slide 45

Slide 45 text

Demo

Slide 46

Slide 46 text

Creating images

Slide 47

Slide 47 text

Manually In container $ apt-get install php5-cli $ echo " /index.php On host $ docker commit

Slide 48

Slide 48 text

Manually In container $ apt-get install php5-cli $ echo " /index.php On host $ docker commit FROM ubuntu RUN apt-get install -y php5-cli RUN echo " /index.php EXPOSE 8000 ENTRYPOINT ["php", "-S", ":8000"] Dockerfile

Slide 49

Slide 49 text

Demo

Slide 50

Slide 50 text

Registry

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

Docker powered mini-Heroku in around 100 lines of Bash.

Slide 53

Slide 53 text

$ git push dokku master

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

PHP Ruby Nodejs Java Scala Go Perl ...

Slide 56

Slide 56 text

$ wget -qO- | sudo DOKKU_TAG=v0.2.3 bash https://raw.github.com/progrium/dokku/v0.2.3/bootstrap.sh

Slide 57

Slide 57 text

Demo

Slide 58

Slide 58 text

Try it!

Slide 59

Slide 59 text

#docker @ freenode http://docker.io

Slide 60

Slide 60 text

Happy shipping!

Slide 61

Slide 61 text

@iam_asm89 https://joind.in/11309