Docker for everything

Preview:

DESCRIPTION

Intro to docker and why you should be using it.

Citation preview

for full stack development

orVagrant is so last year

Why aren't you using

docker yet?

Who am I

Tim Haak@tim_haaktim@haak.co.ukhttps://github.com/timhaakphpsa2014_docker_talk

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

WarningThis presentation may contain pictures of cats!!

First what is docker?

In simple terms it’s a easy way to

create containerized Linux based applications

Without the overhead of virtualization

Why is everyone talking about it

It solves a couple basic problems

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

Simple deployment

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

• Oh and versioning

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

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.

Ok but what are the problems?

Only for Linux

• Personally don’t have a problem with this

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

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.

Biggest problem

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

• Worth it once all the pieces are in place.

Demo Time

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

But I'm on Mac or Windows

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

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

But I thought you said vagrant was so last year

I lied

Its great to get a basic system up and running.

But that’s where you should stop.

Etcd

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

Etcd

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

long-polling

Initial System

Once container has started

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

Questions

Recommended