Docker for

local

Drupal development

Docker?

History of

Local Development

1. Local Installation 

like Acquia Dev Desktop, MAMP, LAMP, XAMP, etc.

  • Hard to install
  • A lot of dependencies on Operating System
  • No multiple Versions
  • Never ever the same as production

2. Virtual Machines

Vagrant, VirtualBox, etc.

  • Installing/Provisioning takes a lot of time
  • Needs a lot of space & resources
  • Hard to build the same system as production

3. Docker

  • No installation per site/container
  • Less usage of space and resources
  • Can be the exact same as in production!

How does Docker work

Virtual Machines

Docker

Main Docker Concept

Docker Image

  • Fully Provisioned
  • Includes everything needed to run
  • Can build on top of another Image
  • Built via Dockerfile

Docker Image Registry

  • Provides Docker Images
  • Saves them as Layers (faster sync)
  • Public one: hub.docker.io
  • Private ones

Docker Container

  • Built from Docker Image
  • Is what actually runs
  • Can mount external files

1. Docker Images are built

2. Docker Image pushed to registry

3. Docker Images are pulled from registry

4. Docker Container created from Image

OK, but why?

  1. Provisioning happens before (ultra fast start of containers)
  2. Everything needed to run is inside an Image
  3. Runs everywhere

Why Docker?

  1. No long waiting
  2. Everything already there
  3. Runs on Linux, Mac, Windows

Why Docker for Local Development?

Okay, let's start!

How to use Docker

  1. Build Docker Images yourself
  2. Use existing Docker Images

Build Docker Images yourself

  • You need knowledge about Hosting
  • You need knowledge about Docker

Existing Docker Images

  • NOT: hub.docker.com/_/drupal/
     
  • github.com/peperoni60/drupal-docker
  • dropdock.io
  • www.kalabox.io
  • drude.io
  • docker4drupal.org
  • dockerdrupal.readthedocs.io
     
  • amazee.io
  • All Services in one:
    PHP, Nginx, Varnish, Solr, Drush, Composer, Console, Xdebug, Blackfire
  • Fully Maintained & Supported
  • Supports custom nginx, solr configs
  • All configs for Drupal
  • Nice URLs
  • Easy Helper Tools

docs.amazee.io

Docker Local Drupal Development

By Michael Schmid

Docker Local Drupal Development

  • 2,453