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

Containerise everything - Why you should stop i...

Containerise everything - Why you should stop installing development environment locally

*** Download the PDF for clickable links! ***

This is a talk from re:develop 2015 conference: http://redevelop.io/

Docker has been getting a lot of cookie points in the DevOps / infrastructure community for delivering a flexible and fast virtualisation technology. However I think an even bigger opportunity is to use Docker containers as neatly packaged development machines, keeping your own machine clean and making development OS agnostic. Working in a team and getting new people up and running should be easy!

In the first part of the talk I’ll outline the benefits of using Docker for development compared to having to install every runtime, tool, and library on your local machine, worrying about OS / setup differences and conflicting versions. I’ll also highlight why is Docker better suited than previous VM solutions like Vagrant with Chef / Puppet, with its smaller resource footprint and faster build times. Using Docker and thinking about how you want to set your container up also ensures that deployment and scalability is given some thought straight from the beginning.

In the second part I’ll do a quick demo to show how easy it is to get started with tools like Docker Machine / Boot2Docker and walk through some practical steps like writing a Dockerfile, compiling a Docker container, using the Docker registry, manipulating Docker instances, installing dependencies and running tools to compile code automatically.

Daniel Demmel

August 14, 2015
Tweet

More Decks by Daniel Demmel

Other Decks in Technology

Transcript

  1. TALK OUTLINE A brief history of the shipping industry What

    is containerisation, why do we need it and how it will change software development A practical introduction to Docker
  2. Handling bulk goods used to be messy and labour intensive…

    https:/ /en.wikipedia.org/wiki/File:Queens_Wharf,_Port_Adelaide,_before_1927.jpeg
  3. …until Malcolm McLean had enough by 1955 and came up

    with standardised, multi-modal containers. https:/ /www.flickr.com/photos/maerskline/7312751706/in/photostream/
  4. This is your development machine with the dependencies for all

    projects, tools, libraries and versions installed on it: https:/ /en.wikipedia.org/wiki/File:Queens_Wharf,_Port_Adelaide,_before_1927.jpeg JAVA 6 JAVA 7 RUBY 2.1 RUBY 1.9 MYSQL 4 MYSQL 5 IO.JS 2.4 NODE 0.8 PHP 5 NODE 0.12 IMAGEMAGICK 6 PHP 4 POSTGRESQL 9 HERE BE DRAGONS SASS 3.4 LIBSASS 3.2 LESS 2.5
  5. PACKAGE MANAGERS Libraries installed locally for each project Easy to

    forget including existing globally installed tools into project package list Falls apart with legacy projects For ex: Bundler, NPM, Maven
  6. VERSION SWITCHERS Picks you the right runtime version to execute

    your code in per folder / project Gets messy with a fair amount of magic to make things happen (and go wrong) For ex: RVM, Rbenv, NVM, JSelect
  7. VIRTUALISATION Totally independent virtual operating systems Can perfectly mirror production

    environment Mostly scripted dependency installation Portable image snapshots For ex: Virtualbox, Vagrant, Puppet, Chef, Salt
  8. CONTAINERISATION Isolated environments reusing host OS core Much smaller and

    no overhead of virtualisation Pretty much instant creation and restart For ex: LXC, Docker, Open Container Initiative
  9. LXC

  10. DOCKER ECOSYSTEM Open source with big and active community Addresses

    several levels of the problem Makes containerisation accessible to all
  11. DOCKER (ENGINE) Abstraction and UX around Linux Containers REST API

    to interact with CLI and remotes Dockerfile as build recipe Portable and incremental images Uses Virtualbox + Boot2Docker on Win / Mac
  12. DOCKER HUB / REGISTRY Github of Docker with public and

    private repos A place to store / share container snapshots Fork or build on top of existing containers API hooks to integrate build / testing pipelines
  13. KITEMATIC A simple GUI to see containers created locally and

    available on Docker Hub Installs everything you need to get started Mac only, but Windows version is coming Not that useful if you want to customise or build on containers, little info shown in search
  14. DOCKER MACHINE Makes it easy to manage containers and hosts

    Works both locally and with cloud providers A quick way to do simple deploys
  15. DEMO (FINALLY!) Walkthrough of Docker boilerplate repo React + Sass

    front end app Express / Node server Gulp build chain package.json, Dockerfile, Makefile Terminal + browser demo Kitematic
  16. “ Containerisation will start a similar revolution in open source

    as Git did, by making it much simpler to take any code and start compiling it right away
  17. QUESTIONS? Yes, we’re hiring, do get in touch: [email protected] Links

    Talk: http:/ /www.danieldemmel.me/blog/ 2015/08/14/containerise-everything/ Git repo: https:/ /github.com/ustwo/docker-node- boilerplate Dockerfile best practices: https:/ /docs.docker.com/ articles/dockerfile_best-practices/
  18. CREDITS Talk is Creative Commons Attribution 4.0 International Image credits

    as attributed on respective slides Vector icons from the Noun project Package: https:/ /thenounproject.com/search/?q=package&i=10996 Switch: https:/ /thenounproject.com/search/?q=switch&i=79501 Virtualisation: https:/ /thenounproject.com/term/data-center-server- virtualization/95507/ Container: https:/ /thenounproject.com/term/shipping-container/116963/