Docker (not just) for Rubyists

Docker

Ruby Usergroup Hamburg · May 11th, 2016


Thilo-Alexander Ginkel · TG Byte Software GmbH

About /me

About /me

  • Thilo-Alexander Ginkel

  • Freelance Software Engineer and Consultant

  • <3 Ruby

  • Full-stack software engineer, but I especially like

    • Backend development

    • DevOps including Docker, Ansible, Puppet

"But it works for me!"

Docker

Docker

  • Container-based virtualization

now what finding nemo

Docker Container vs. VM

VM

  • Hardware-based virtualization

  • OS-agnostic, i.e., most OSes are supported as guest

  • VM typically hosts a full-blown operating system

Docker Container

  • Technically, a mash-up of existing tech + a few novel parts

  • Containers share the host’s Linux kernel, i.e., no hypervisor

  • Mashup of existing technologies

    • Linux Kernel namespaces (isolation)

    • cgroups ("control groups"; resource isolation)

    • chroot (file system isolation)

    • UnionFS (file system overlay)

    • networking (iptables, bridge networks)

  • Plus a novel application packaging format (standardized by OCI)

Docker Container vs. VM

vm vs container

Philosophy

Philosophy

  • "Build once, run anywhere"

  • Containers…​

    • …​consist of just what’s needed to run a given service

    • …​are short-lived

    • …​should be state-less

  • Immutable infrastructure / "cow vs. cattle"

Terminology

Terminology

  • Image

    • Immutable layered set of file system changes on top of a base image

  • Container

    • A running instance of an image

    • Note: There can be many instances of the same image

Layers

Layers

layers

Architecture

Architecture

architecture

Demo Time

Why use Docker?

Why use Docker?

  • "Build once, run anywhere"

  • Exactly what is tested is later deployed to production

  • Self-contained deployment units avoid "dependency hell"

  • Stateless containers are easy to scale and upgrade

  • Rolling "zero downtime" deployments

Delivery Pipeline

Delivery Pipeline

pipeline

Questions?

Thank you!

Image Credits