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.
2. I’M DANIEL DEMMEL (@DAAAIN)
I work at
We design, build and launch
digital products
3. 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
4. Handling bulk
goods used to be
messy and labour
intensive…
https://en.wikipedia.org/wiki/File:Queens_Wharf,_Port_Adelaide,_before_1927.jpeg
5. …until Malcolm
McLean had
enough by 1955
and came up with
standardised,
multi-modal
containers.
https://www.flickr.com/photos/maerskline/7312751706/in/photostream/
10. SO WHAT IS THE
PROBLEM WITH
DEVELOPMENT
ENVIRONMENTS?
11. 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.2LESS 2.5
12. But it could be
neat like
Malcolm’s port:
https://www.flickr.com/photos/maerskline/7312751706/in/photostream/
JAVA 6
RUBY 1.9
MYSQL 5
NODE 0.8
PHP 5
…
POSTGRESQL 9
…
…
14. 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
15. 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
16. 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
17. 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
19. DOCKER ECOSYSTEM
Open source with big and active community
Addresses several levels of the problem
Makes containerisation accessible to all
20. 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
21. 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
22. 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
23. DOCKER MACHINE
Makes it easy to manage containers and hosts
Works both locally and with cloud providers
A quick way to do simple deploys
24. 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
26. “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
27. QUESTIONS?
Yes, we’re hiring, do get in touch: dain@ustwo.com
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/
28. 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/