Slide 1

Slide 1 text

Containers Patterns for Rails Jairo Diaz @codescrum London Ruby User Group Sep 2015

Slide 2

Slide 2 text

Overview ● Pets vs Cattle ● Containers vs Virtual Machines ● Running Rails on Containers ○ Docker compose ○ Kubernetes

Slide 3

Slide 3 text

Pets vs Cattle ● Pets are given names ● They are unique, lovingly hand raised ● When they get ill, you nurse them back to health ● Cattle are given numbers ● They are almost identical to other cattle ● When they get ill, you get another one

Slide 4

Slide 4 text

Containers vs Virtual Machines

Slide 5

Slide 5 text

Docker: A happy family! Docker Go Language Linux Docker Engine Docker Machine Docker Compose Docker Hub

Slide 6

Slide 6 text

Mac OS Setup for Docker rais-image Local environment Docker Machine (with daemon) db-image rais-app-1 rais-app-2 db ruby-image ruby-image db-image other-image Docker Hub (On the Internet) Dockerfile

Slide 7

Slide 7 text

Rails with Docker Compose

Slide 8

Slide 8 text

Rails with Docker Compose File: docker-compose.yml (½)

Slide 9

Slide 9 text

Rails with Docker Compose File: docker-compose.yml(2/2)

Slide 10

Slide 10 text

Rails with Kubernetes rais-image Local environment Kubernetes Minion db-image rais-app-1 rais-app-2 db ruby-image Kubernetes Master APIs Replication Controller Scheduler etcd Kubelet Proxy Replication Controller Web Service Db Service Replication Controller CLI

Slide 11

Slide 11 text

More information: Code examples at: http://github.com/codescrum/ Blog post on docker compose: http://blog.codescrum.com/ Get in touch with Jairo Diaz @codescrum