getting up and running with docker

42
getting it running and the initial “aha Erlebniss" @ndemoor

Upload: nils-de-moor

Post on 15-Jul-2015

460 views

Category:

Engineering


5 download

TRANSCRIPT

Page 1: Getting up and running with Docker

getting it running and the initial “aha Erlebniss"

@ndemoor

Page 2: Getting up and running with Docker

Hi! I’m Nils De Moor CTO/cofounder at WooRank Docker Belgium MUG AWS Belgium MUG

That’s me!

Page 3: Getting up and running with Docker

A tale of many hats

Page 4: Getting up and running with Docker
Page 5: Getting up and running with Docker
Page 6: Getting up and running with Docker
Page 7: Getting up and running with Docker
Page 8: Getting up and running with Docker
Page 9: Getting up and running with Docker

version drift

Page 10: Getting up and running with Docker

Dev Test Prod

PHP 5.5 5.4 5.3

Node 0.12.8 0.10.32 0.10.28

MySQL 5.6 5.5 5.5

<insert new hipster language> 0.1.17-RC1 0.1 ?

Page 11: Getting up and running with Docker

Virtual Machines

Page 12: Getting up and running with Docker
Page 13: Getting up and running with Docker
Page 14: Getting up and running with Docker

Prod

Test

Dev 1

Page 15: Getting up and running with Docker
Page 16: Getting up and running with Docker

Simple Isolated Portable Automated Flexible Versioned

Page 17: Getting up and running with Docker
Page 18: Getting up and running with Docker
Page 19: Getting up and running with Docker

“Ship anything... anywhere”

Page 20: Getting up and running with Docker

Dev Test Prod

PHP 5.5 5.4 5.3

Node 0.12.8 0.10.32 0.10.28

MySQL 5.6 5.5 5.5

<insert new hipster language> 0.1.17-RC1 0.1 ?

Page 21: Getting up and running with Docker

Dev Test Prod

PHP

Node

MySQL

<insert new hipster language>

Page 22: Getting up and running with Docker

Docker Registry

Docker Image

Page 23: Getting up and running with Docker
Page 24: Getting up and running with Docker
Page 25: Getting up and running with Docker

$docker run ubuntu echo “Hello World”

Page 26: Getting up and running with Docker

# DockerfileFROM ubuntu:14.04

ENV DEBIAN_FRONTEND noninteractive

# bring apt up-to-date and install memcachedRUN apt-get update -y \&& apt-get install -y memcached

# run as user daemon (memcached doesn't allow to run as root)USER daemon

# expose port to other containersEXPOSE 11211

# Launch memcached when launching the containerENTRYPOINT ["memcached"]

Page 27: Getting up and running with Docker

$docker build -t ndemoor/memcache .

$docker run \ -d —-name mc \ ndemoor/memcache

$docker logs mc

$docker stop mc

$docker push ndemoor/memcache

Page 28: Getting up and running with Docker

# DockerfileFROM node:0.10.38

# Define app root dirWORKDIR /var/www

# Add package file to root dirADD ./package.json /var/wwwRUN npm install --production

# Add our application codeADD . /var/www

# Create mount point for application dataVOLUME /var/data

# Launch applicationCMD [“npm”, “start”]

Page 29: Getting up and running with Docker

$docker build -t ndemoor/my-node-app .

$docker run \ -d -p 3000:3000 —-name app \ -v /data/node-app:/var/data:rw \ ndemoor/my-node-app

$docker push ndemoor/my-node-app

Page 30: Getting up and running with Docker

containers: web: build: . command: npm start —-dev ports: - "3000:3000" volumes: - .:/var/www

- /data/node-app:/var/data links: - mc environment: - PORT=3000

- MY_ENV=dev mc: image: ndemoor/memcache

Docker Compose

Page 31: Getting up and running with Docker

$docker-compose up

$docker-compose run app migration.sh

Page 32: Getting up and running with Docker

$machine create -d virtualbox dev

$machine ls

$machine create -d digitalocean --digitalocean-access-token=... staging

$machine create -d aws ...

Docker Machine

Page 33: Getting up and running with Docker
Page 34: Getting up and running with Docker
Page 35: Getting up and running with Docker
Page 36: Getting up and running with Docker

$swarm create 6856663cdefdec325839a4b7e1de38e8

# start the swarm agent on each node $swarm join --discovery token://<cluster_id> --addr=<node_ip:2375>

# start the manager on any machine $swarm manage --discovery token://<cluster_id> -H tcp://<swarm_ip:swarm_port>

Docker Swarm

Page 37: Getting up and running with Docker
Page 38: Getting up and running with Docker
Page 39: Getting up and running with Docker
Page 40: Getting up and running with Docker

http://www.meetup.com/Docker-Belgium

Page 41: Getting up and running with Docker

Thank You!

@ndemoor

Page 42: Getting up and running with Docker

Photo Credit

http://static2.theguideistanbul.com/media/content_files/images/01/50/48/b_15048.jpeg http://2eof2j3oc7is20vt9q3g7tlo5xe.wpengine.netdna-cdn.com/wp-content/uploads/2014/05/virtual-machine-logo-370x261.jpg http://upload.wikimedia.org/wikipedia/commons/6/6f/Juggling_Clubs_Manuel_and_Christoph_Mitasch_11_club_passing.jpg http://www.docker.com