docker for everything

30
for full stack development

Upload: timhaak

Post on 19-Jun-2015

234 views

Category:

Technology


2 download

DESCRIPTION

Intro to docker and why you should be using it.

TRANSCRIPT

Page 1: Docker for everything

for full stack development

Page 2: Docker for everything

orVagrant is so last year

Why aren't you using

docker yet?

Page 3: Docker for everything

Who am I

Tim Haak@[email protected]://github.com/timhaakphpsa2014_docker_talk

Company: AfrihostWhat I do: Bit of everything from server to frontend

Page 4: Docker for everything

WarningThis presentation may contain pictures of cats!!

Page 5: Docker for everything

First what is docker?

Page 6: Docker for everything

In simple terms it’s a easy way to

create containerized Linux based applications

Page 7: Docker for everything

Without the overhead of virtualization

Page 8: Docker for everything

Why is everyone talking about it

Page 9: Docker for everything

It solves a couple basic problems

Page 10: Docker for everything

Simple deployment

• Matter of seconds to start and image – Same speed as starting the programs inside the

image• Central repository for images– Similar to github– Public, Private and self hosted available

Page 11: Docker for everything

Simple deployment

• Can start multiple copies quickly• Simple rollback – With in reason

• Oh and versioning

Page 12: Docker for everything

Repeatability

• You can test the exact image that you will run on the server

• Allows for simpler testing• There is no difference between testing and dev.

• It should remove but it worked on my pc excuse• Documented install steps – Stops the I can’t remember what’s installed on this

server

Page 13: Docker for everything

Simpler to scale

• You can simply move multiple containers on one server to many

• If you follow best practices– This should be obvious but we all know how it

goes• Allows you to run multiple flavors and versions

of Linux on one server.

Page 14: Docker for everything

Ok but what are the problems?

Page 15: Docker for everything

Only for Linux

• Personally don’t have a problem with this

Page 16: Docker for everything

More moving parts

• Can add complication compared to running a single server• But more than makes up for it as you scale

• Not as simple as just logging into a server to check how its working

Page 17: Docker for everything

Not for everything

• Would not use it for larger critical DB’s– You generally want to be a close to the metal as

possible• Though great for you local development DB– Though needs to be smaller than 10G– There are workarounds for this.

Page 18: Docker for everything

Biggest problem

• It works slightly differently and people will have to learn something new.

• Worth it once all the pieces are in place.

Page 19: Docker for everything

Demo Time

Page 20: Docker for everything

Install Docker

• Get Ubuntu 12.04/14.04– Or flavor of choice

• Follow how to on dockers site– https://docs.docker.com/

• Done– Very good documentation

Page 21: Docker for everything

But I'm on Mac or Windows

• Vagrant–http://www.vagrantup.com/

• Boot2Docker–https://github.com/boot2docker

Page 22: Docker for everything

But I thought you said vagrant was so last year

Page 23: Docker for everything

I lied

Page 24: Docker for everything

Its great to get a basic system up and running.

But that’s where you should stop.

Page 25: Docker for everything

Etcd

• Simple, curl-able API (HTTP + JSON)• Optional SSL client cert authentication• Benchmarked 1000s of writes/s per instance• Properly distributed using Raft protocol

Page 26: Docker for everything

Etcd

• Keys support TTL• Atomic test and set• Easily listen for changes to a prefix via HTTP

long-polling

Page 27: Docker for everything

Initial System

Page 28: Docker for everything

Once container has started

Page 29: Docker for everything

Some tips

• Separate your programs• Don't repeat step build a base image• Store persistent data externally• Build containers to be thrown away• Put all the steps in the Docker file• Use env variables

Page 30: Docker for everything

Questions