Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Docker - Building Happier Dev environments

Docker - Building Happier Dev environments

Given at Oxford Docker user group 11th Nov 2015

Graham Gilchrist

November 11, 2015
Tweet

Other Decks in Technology

Transcript

  1. Scenario 2 - The new member of staff Image credit:

    Paul Inkles https://www.flickr.com/photos/dumfstar/8553473662
  2. The problem • Large number of projects and variations on

    environments • Different hardware, operating systems and software versions trying to run same project • Environment setup in installation guide is forgotten or becomes out of date • All these things take up your time to maintain, often fixing the same issue on multiple machines
  3. How do we keep the environments consistent and automate this

    boring job? Image credit: Steve Jurvetson https://www.flickr.com/photos/jurvetson/9690512888/
  4. We want a solution that: 1. Stores environment config versioned

    with project code 2. Makes everyone use the same environment 3. Is reproducible from scratch 4. Automate the build process
  5. Advantages of Docker over VM • Run speed • Build

    speed (image and build step caching) • Disk space - economical re-use of base system images etc. • Re-use of common services between projects • Large resource of pre-built community images setup via the docker hub image registry
  6. python docker-compose.yml python: build: python/ command: manage.py runserver environment: DATABASE_URL:

    'postgres://dbname@db/postgres' volumes: - ./python:/usr/src/app links: - db ports: - "8000:8000" db: image: postgres:9.3 ports: - "5432:5432"
  7. python Dockerfile FROM python:3.4.3 # We add libmemcached from debian

    repositories RUN apt-get update && \ apt-get install -y \ libmemcached-dev \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY requirements.txt /usr/src/app/ RUN pip install -r requirements.txt
  8. NodeJS docker-compose.yml grunt: build: node/ volumes: - ./web:/usr/src/app command: grunt

    bower: image: blinkmobile/bower:1.3.12 environment: bower_allow_root: true bower_analytics: false working_dir: /data volumes: - ./web:/data
  9. How is it working out for us? Much higher bus

    factor Saving time Image credits: Tom Page https://www.flickr.com/photos/tompagenet/6935847473/ Steve Collis https://www.flickr.com/photos/swampa/8105520673/
  10. Outstanding issues • Mac OS - not native ◦ slow

    for disk access via volume mounts • SSH issues ◦ rsync, ssh ◦ installing packages via github ssh auth • Learning curve for 'the docker way' ◦ Separation concepts are hard and totally new to most devs. ◦ Hard to get people to configure it themselves
  11. Future improvements Identical dev / Deployment setup Issues on Mac

    OS Image credit: Steve Jurvetson https://www.flickr.com/photos/jurvetson/3327872958