Top Banner
Introduction to Docker Containerization is the new virtualization James Turnbull @kartar 1
36
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Docker

Introduction to DockerContainerization is the new virtualization

James Turnbull@kartar

1

Page 2: Introduction to Docker

who• VP of Engineering at Kickstarter

• Advisor at Docker

• Open source chap

• Funny accent

2

Page 3: Introduction to Docker

Kickstarter live in Sweden

3

Page 4: Introduction to Docker

The Docker Book

www.dockerbook.com4

Page 5: Introduction to Docker

Who are you folks?

5

Page 6: Introduction to Docker

What's this all about?

6

Page 7: Introduction to Docker

What is Docker?

7

Page 8: Introduction to Docker

Container virtualization

8

Page 9: Introduction to Docker

Build, ship, run

9

Page 10: Introduction to Docker

Build once

10

Page 11: Introduction to Docker

Run in many places

11

Page 12: Introduction to Docker

IsolatedLayeredStandard

Content agnostic12

Page 13: Introduction to Docker

But this isn't new?!?

13

Page 14: Introduction to Docker

So why should I care?Software delivery mechanism

PortabilityA bit like a VM but ...

14

Page 15: Introduction to Docker

... not like a VM1. Containers boot faster

2. Containers have less overhead

3. Containers bring native performance

4. Containers are Cloud & VM-compatible

15

Page 16: Introduction to Docker

Devs care about their app

Ops cares about the containers

16

Page 17: Introduction to Docker

Why developers care...

• Clean, safe, hygienic and portable

• No worries about dependencies

• Encourage good architecture

17

Page 18: Introduction to Docker

Why operations care...

• Make the lifecycle more efficient

• Eliminate inconsistencies

• Support segregation of duties

18

Page 19: Introduction to Docker

What can I use Docker for?

• Docker for CI/CD

• Packaging and deploying applications

• Build your own PAAS

• Deploy applications at hyperscale!

19

Page 20: Introduction to Docker

Does this work with Puppet or Chef?

• Chef and Puppet are state management tools

• Less complex

• Docker images are version controlled and layered

• Smaller, self-contained and lightweight

20

Page 21: Introduction to Docker

Technology Stack

• Runs on most Linux distros

• Boot2Docker for OSX and Windows

• Windows in the works!

• Uses Linux kernel features

21

Page 22: Introduction to Docker

Docker BasicsImage & Dockerfile

The Docker HubContainer

22

Page 23: Introduction to Docker

Building Docker images FROM ubuntu MAINTAINER James Turnbull "[email protected]"

RUN apt-get -qqy update RUN apt-get install -qqy apache2 ADD index.html /var/www/

ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_LOG_DIR /var/log/apache2

VOLUME [ "/var/log/apache2" ] EXPOSE 80

ENTRYPOINT ["/usr/sbin/apache2"] CMD ["-D", "FOREGROUND"]

23

Page 24: Introduction to Docker

Building the image$ sudo docker build -t="jamtur01/0redev" .

24

Page 25: Introduction to Docker

Sharing the image$ sudo docker push jamtur01/0redev

25

Page 26: Introduction to Docker

Running the container$ sudo docker run --name mywebsite -ti -p 80:80 jamtur01/0redev

26

Page 27: Introduction to Docker

But there's more!

27

Page 28: Introduction to Docker

What if we could componentize . . .

28

Page 29: Introduction to Docker

SSH

29

Page 30: Introduction to Docker

Managing a container$ sudo docker exec -ti mywebsite /bin/bash

30

Page 31: Introduction to Docker

Scheduling and jobs

31

Page 32: Introduction to Docker

Logging

32

Page 33: Introduction to Docker

Logging container$ sudo docker run --volumes-from mywebsite -ti ubuntu tail -f /var/log/apache2/acccess.log

33

Page 34: Introduction to Docker

Creates a new architecture

34

Page 35: Introduction to Docker

A new architecture that ...• Separates orthogonal concerns

• Don't rebuild your app to change services

• Have different policies in domains

• Ship lighter apps

35

Page 36: Introduction to Docker

Questions?

36