Public | Automated Build

Last pushed: a year ago
Short Description
This provides docker images for the Simple Drupal Docker Toolset.
Full Description

Drupal development toolkit based on Docker

Visit at Github Pages:

With this toolset, you can install docker and easily fire up any existing Drupal (or php) webroot in 2 seconds.

  • drupal 6,7,8 (or basically any PHP app by disabling the drupal check, NO_DRUPAL_CHECK=1)
  • SSL support
  • PHP 5.4, 5.6 (default), 7.0
  • Apache 2.2
  • one MySQL container for all projects (data saved in your local home-folder).
  • one Drupal container + hostname per project
  • Solr 4 container for each project, data storage in project folder, and auto-using of search_api_solr config files.
  • mailsink that collects al emails sent through sendmail (/tmp/d7-docker-mailsink on host)
  • varnish out-of-the-box (See 'CUSTOM PROJECT CONFIGURATION')
  • memcache
  • custom mounts, dns entries, solr-config, local hostnames
  • XHProf / XHGui


Simple Drupal Docker Toolset is sponsored and supported by Finalist B.V.


Get this toolset first

Clone git repository somewehere in local folder, or download archive package, and unpack.

git clone ~/docker-drupal

GNU/Linux distro:

  • Install docker:
    • curl -sSL | sh
  • Add yourself to docker group:
    • sudo usermod -aG docker [YOUR USER]
  • Then, logout your system and login again
  • Run bin/ to symlink all needed scripts to your bin folder.
  • Give write access to yourself on hosts file:
    • sudo chown root:$(whoami) /etc/hosts
    • sudo chmod 664 /etc/hosts



  • Install toolbox from
  • Open Docker Quickstart Terminal and close when finished
  • Open VirtualBox and assign more CPU's to the 'default' VM, as it will be quite slow by default (only 1 CPU)
  • Add your user to 'wheel' group, in terminal (so the toolset can add hostname-entries to your hosts file):
    • sudo dseditgroup -o edit -a $(whoami) -t user wheel
  • Give wheel-group write access to hosts file, in terminal:
    • sudo chmod 664 /etc/hosts
  • Run the following command to symlink all needed scripts to your bin folder.
    • sudo bin/


Do a git pull to fetch the latest master-branch for this toolset.
Then, run bin/ again.


    - d7-start                        : start drupal 7 container from project folder
    - d7-stop                         : stop container for 'this' project
    - d7-mysql-start                  : start mysql container (triggered by d7-start)
    - d7-mysql-stop                   : stop mysql container
    - d7-solr4-start                  : start solr4 container (triggered by d7-start)
    - d7-solr4-stop                   : stop solr4 container
    - d7-status                       : shows all docker containers (running and stopped)
    - d7-stop-all                     : stops all drupal toolset related containers
    - d7-update-images                : Will pull updated images from repository.
                                        You should run this every once in a while.
    - d7-cleanup                      : Cleanup (stop + remove) all drupal 7 containers.
                                        They are disposable, and usually removed immediately
                                        when you stop a d7 container.
    - d7-logs [num|all]               : Tail all apache logs.
                                        Argument sets number of lines to print, before following.
                                          (Should be integer, or 'all')
                                        Starts 'docker logs --tail=[num] -f [container]'
    - d7-ssh [container (optional)]   : Open shell (bash) in container. Defaults to container in current webroot folder.
    - d7-drush [drush arguments]      : This runs drush with supplied arguments, in the webroot, as web user.
                                        You can alias this if you'd make this transparent on your system, by adding
                                        alias drush="d7-drush"   to your .bashrc file (~/.bashrc).
    - d7-help                         : Show README

Commands for toolset development

    - d7-build-docker-image           : Build / rebuild docker images. This replaces images that are downloaded from dockerhub.


To start your project, go to the project folder, and run 'd7-start'
Note that settings.php must contain the mysql-host '',
and that solr is reachable at localhost:8983 from each drupal container.

Building docker images is done the first time you use them ("d7-start"), and can take a while.

Common hostnames

  • : Location of mysql server, reachable from host and container
  • dockerhost : Location of your laptop / server. Reachable from container.
                                   To make it reachable from your laptop/server,
                                   just add ' dockerhost' to /etc/hosts .


Custom docker stuff per project:
Add file .d7-docker.conf to your project folder.

Be aware that any bash code in this file is actually executed

Example content of file:

    # Add dependency container.
    # Format: [container name]:[start-script/command]
    #   "docker.mysql:${mydir}/"
    #   "docker.solr4:${mydir}/"
    # )
    # Add custom link between containers.
    # Format: [dependency container name]:[hostname in 'this' container, mapped to dependency]
    # CUST_LINK=(
    #   ""
    #   ""
    # )
    # Mount extra volumes in container.
    # Format: [local folder]:[folder in container]
    # CUST_VOL="/opt/simplesamlphp:/opt/simplesamlphp1"
    # Give container extra hostnames.
    #   ""
    # )
    # Provide DNS (hosts-file) entries to container, so container can resolve it.
    # For example usefull if you're having trouble to get docker to communicate through host-system VPN.
    # CUST_DNS=(
    # )
    # Do not check if this is actually Drupal. Usable for 'other' php apps to be ran in
    # a D7 container.
    # Enable Varnish cache engine
    # Note: This will run Varnish on port 80 (so Drupal can talk to varnish on
    # and Apache on port 90.
    # Note: To purge a page, let Drupal call URL's on varnish with the PURGE-method (like GET, but
    # make it PURGE...). The purge and expire modules are a very useful combination to do this.
    # Enable memcache daemon
    # Enable XHGui (Currently only for php 5.6).
    # Visit xhgui at /xhgui .
    # Note that it takes some time to start mongodb.
    # Set PHP version to use
    # PHP_VERSION=5.4
    # Supported versions: 5.4, 5.6, 7.0.
    # Defaults to 5.6
    # Custom per-project php.ini
    # CUST_PHP_INI="/opt/web/flightcontrol/php.ini"
    # Make sure to use an absolute path here!
    # Custom location for Solr config files.
    # Note that the toolset finds 'search_api_solr/solr-conf/4.x' automatically.
    # Only use this if you use some other module, or schema files of your own.
    # SOLR_CONF_OVERRIDES='sites/all/modules/contrib/search_api_solr/solr-conf/4.x'

Use of XDebug

XDebug is installed in the container.
To use it with php-storm

That's all...

To use XDebug profiler, just add a 'profiler' folder in your project.
It will generate cachegrind files that you can open with KCacheGrind or any other tool.

Override MySQL configuration.

Put your (extra) configuration in ~/.drupal_docker_toolset/mysql.cnf and restart mysql
by executing d7-mysql-stop && d7-mysql-start.

Example content:

  table_open_cache = 2000
  innodb_buffer_pool_size = 3G
Docker Pull Command