whoami

  • Sergey Kibish
  • Full Stack Web Dev @ Transact Pro
  • Simplicity is a 🔑
  • ♥ Music

Docker in da house

Development environment reimagined

By Sergey Kibish / @s_kibish

Today I will talk about

  • What is Docker
  • Why to use it for Development
  • TODO application
  • Q&A time

Docker

Container

Background

  • Linux containers introduced in 2008
  • Problem with common OS kernel is solved

Cons

  • Lightweight
  • Open
  • Secure
Docker Hub

Development

  • Consistent development environments
  • env(dev) == env(prod)
  • You only need Docker
  • Different language versions without hacks
  • Can use editor/IDE Normally

Easy

Installation

Docker Toolbox

Installation

$ apt-get install docker-engine

Docker compose

Docker Compose
“Compose is a tool for defining and running multi-container applications with Docker. With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running.”

Not bad

docker-compose.yml

web:
  image: nginx:latest
  ports:
    - 80:80
  volumes:
    - .:/var/www/html
    - ./config/vhost.conf:/etc/nginx/conf.d/vhost.conf
  links:
    - php
php:
  build: ./config/php
  volumes:
    - .:/var/www/html
    - ./config/php-fpm.conf:/etc/php5/fpm/php-fpm.conf
  links:
    - db
db:
  image: mysql:latest
  ports:
    - 3306:3306
   environment:
    - MYSQL_ROOT_PASSWORD=root
    - MYSQL_DATABASE=todo

Demo time!

Why?

Composer

$ docker pull composer/composer

Back to demo

Dockerfile


FROM php:5.6-fpm

RUN apt-get update && apt-get install -y \
  libmcrypt-dev \
  libpq-dev \
  && docker-php-ext-install mcrypt mbstring \
  && docker-php-ext-install mysqli pdo pdo_mysql tokenizer

EXPOSE 9000

CMD ["php-fpm"]
          

Layers

Bonus

  • Queue
  • Worker
  • Generator

Do we use it?

How

  • 20+microservices
  • Spinning on all team member machines
  • MySQL, Redis, Queues, different languages

Contacts