# Drupal 8 contributed modules using Docker

> For a fair amount of time I’m contributing to Drupal in the form of Contributed Modules, patches to Core and Documentation. This article outlines my experience learning to contribute to Drupal and why I \[…\]

Source: https://antistatique.net/en/blog/drupal-8-contributed-modules-using-docker

Category: Development

# Drupal 8 contributed modules using Docker

Author(s)

[

![Kevin](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2020/12/Kevin-300x300.jpg)



](/en/agence/kevin)

[Kevin](/en/agence/kevin)26 August 2020

For a fair amount of time I'm contributing to Drupal in the form of **Contributed Modules**, patches to **Core** and **Documentation**.

To be franc - I don't want to read the story. [Bring me to the Docker usage](#how-to)

During my journey as a contributor I have been stuck trying to solve some simple problems:

-   How to contribute to many modules without having to Bootstrap a Drupal project for each of them ?
-   How to tests those modules in a different version of Drupal to ensure compatibility and stability ?
-   How could I accelerate my development by isolating my modules from each other ?
-   When one of my contributed modules required 3rd-party integration (Solr, Elasticsearch, Redis), How can I isolate the installation of it ?

This article outlines my experience learning to contribute to Drupal and why I created [Drupal Docker Container for Contributions](https://github.com/wengerk/docker-drupal-for-contrib). A Docker image for Drupal contributors giving a solution to quickly setup a Docker for both contributed modules or contributed themes.

## The Bad Fish Paradigm

![A big fish in a small pond 🐟](https://images.statique.ch/t/w_750,f_jpeg,q_70/wp/app/uploads/2021/04/fish_masks-2600x998.jpg)

A big fish in a small pond 🐟

My journey started 4 years ago. During my first year of contribution I had a single "Drupal Sandbox" project and decided to symlinked all contributed modules I developed for in the `modules/contrib` directory.

Some would say I put all my eggs in one basket ... But guess what ? Yes I did, and it worked ....

Well it worked, until I developed 20+ contributed modules symlinked on the same "Drupal Sandbox".  
Imagine dealing with each modules being in a pretty unstable release (`dev` branch FTW 🎉), sometimes requiring different version of the same dependency or just not being compatibly with the same Drupal version.

I got stuck and everything explode spectacularly 💣 💥.

## The Spaghetti Catalyst

![Maintenance is easy with everything in one place - isn'it ? 🙈](https://images.statique.ch/t/w_750,f_jpeg,q_70/wp/app/uploads/2021/04/a0c219b692de5e74be641bf713d1b67e_original_1.png)

Maintenance is easy with everything in one place - isn'it ? 🙈

Well obviously having one single "Drupal Sandbox" project was not a pretty good idea.

> “ diaírei kài basíleue, in ancient Greek: «divide and rule ”
> 
> Philip II of Macedon

So I decided to split my "Drupal Sandbox" into multiple "Drupal Sandboxes" each by Drupal version I wanted to support ("Drupal Sandbox 8.6", "Drupal Sandbox 8.8", ...).  
This solution solved my incompatible dependencies problem and my cascade of unstable modules as I isolated every module into its own Sandbox when it was necessary.

At this time, I was an active maintainer of [Travis CI](https://github.com/LionsAd/drupal_ti), a Travis solution to test Drupal modules with PHPUnit. I added it on each of my projects and used the used it for automated testing on CI - allowing me to tests multiple versions of Drupal on CI.

Once again, it worked .... I had to deal with many "Drupal Sandboxes" (growing each days), but it works.

Well it worked, until I had to deal with bigger contributed modules requiring different PHP versions and requiring 3rd-party such as Redis, Solr Elasticsearch (obviously each of them in many disparate versions for backward compatibilities :party:).  
Once more, imagine me trying to make sense of all those Spaghetti "Drupal Sandboxes", having different symlinked projects, connected to 3rd-party software (each one in a different random port 😵) ...

I got overwhelmed by all those "Drupal Sandboxes" and Services 🙀 .

## The Space Whale Resurgence

![Just keep swimming 🐳](https://images.statique.ch/t/w_750,f_jpeg,q_70/wp/app/uploads/2021/04/diu56ukw4aeujrj.jpg)

Just keep swimming 🐳

Well ... Obviously working locally was driving me crazy. I had to figure out how to works with those modules in a complete new way.  
I decided to get the problem upside down.

Docker seems promising, it solves the isolations problems, the server architecture versions and it will accelerate my development by containerising all the necessary services ... Bonus point, it will make my modules way more easy to contribute to 💪 .

So I dive into this exciting new idea.

I started looking for Drupal Docker images and found a bunch of them [Docker Hub](https://hub.docker.com/search?q=drupal&type=image).  
Unfortunately, my dreams fade quickly 😿 ... all of those images serve the same purpose, integrate Docker into a complete Drupal project, none of them was made for standalone modules/themes contributions.

Well ... nothing seems to exist as I need it ... Then I decided to create my own, extending the official Drupal images for standardization and stability .

## How to use this image

Create a `Dockerfile` file at the root level of your contributed modules/themes

You may want to update the default `BASE_IMAGE_TAG` to be used following your module current supporting version.

-   Then create a `docker-compose.yml` file in the same location and update the mounted volume name to match your custom module name

Spin up the Docker integration

(Optionally) You may want to setup a different Drupal Docker versions for testing, then use the build argument `BASE_IMAGE_TAG`

## Travis Integration example

Now having a Docker working environment, let's use it to run our tests inside our containers.

Create a `.travis.yml` file at the root level of your repository

## Feedback

At any point during the contributing process I would love to help! For help with a specific problem you can open an issue on [GitHub](https://github.com/WengerK/docker-drupal-for-contrib/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc).

## Usage examples

-   [Template Whisperer](https://github.com/antistatique/drupal-template-whisperer)  
    Functional (Browser) and Kernel tests
-   [CKEditor Non-breaking space Plugin](https://github.com/antistatique/drupal-ckeditor-nbsp)  
    Functional (Javascript) and Kernel tests
-   [Commerce Google Tag Manager Enhanced Ecommerce](https://github.com/gridonic/commerce_google_tag_manager/tree/8.x-2.x)  
    Functional (Browser), Unit and Kernel tests
-   [Backerymails](https://github.com/antistatique/drupal-backerymails)  
    Functional (Browser) and Kernel tests
-   [Bamboo Twig](https://github.com/antistatique/drupal-bamboo-twig)  
    Functional (Browser) and Kernel tests
-   [Loco Translate](https://github.com/antistatique/drupal-loco-translate)  
    Functional (Browser), Unit and Kernel tests
-   [Potion](https://github.com/antistatique/drupal-potion)  
    Unit and Kernel tests
-   [Commerce TrustedShops](https://github.com/antistatique/drupal-commerce-trustedshops)  
    Functional (Browser), Unit and Kernel tests
-   [Vercel deploy](https://github.com/antistatique/drupal-vercel-deploy)  
    Functional (Browser) tests

## Sources

For the most curious of you, here are some sources of additional information that inspired the creation of this article.

**Github** (21 August, 2020). Drupal Docker Container for Contributions  
Seen on [https://github.com/wengerk/docker-drupal-for-contrib](https://github.com/wengerk/docker-drupal-for-contrib)

**Tess Flynn** (07 August, 2020). Drupal Development with Docker  
Seen on [https://drupalize.me/series/drupal-development-docker](https://drupalize.me/series/drupal-development-docker)

**Drupal Documentation** (21 August, 2020). Docker based development environment  
Seen on [https://www.drupal.org/node/2736447](https://www.drupal.org/node/2736447)

**Pierre Abreu** (14 April, 2019). Improve Drupal 8 performance on Docker and OSX  
Seen on [https://medium.com/faun/improve-drupal-8-perf...](https://medium.com/faun/improve-drupal-8-performance-on-docker-and-osx-36134738e57)

**Gerardo Fernández** (19 December, 2019). How to integrate Docker into a Symfony-based project  
Seen on [https://medium.com/@ger86/how-to-integrate-...](https://medium.com/@ger86/how-to-integrate-docker-into-a-symfony-based-project-f06164dc7944)

## Need help with your [Drupal](https://antistatique.net/en/services/drupal) project? We have the expertise you need.

## More articles

Author(s)

[

![Anthony](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2024/11/anthony-1-300x300.png)



](/en/agence/anthony-salamone)

[Anthony](/en/agence/anthony-salamone)28 September 2026

### [Smashing Conference Freiburg 2026](/en/blog/smashing-conference-freiburg-2026)

Back in Freiburg for Smashing Conference 2026: AI and design systems, deeply technical CSS and HTML, and more human talks about teams and mindset. Here's what we took away.

Back in Freiburg for Smashing Conference 2026: AI and design systems, deeply technical CSS and HTML, and more human talks about teams and mindset. Here's what we took away.

[

![Smashing Conference Freiburg 2026 poster](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/assets/blog/smashing-2026.png)



](/en/blog/smashing-conference-freiburg-2026)

Author(s)

[

![Akira](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2025/03/akira-small-300x300.jpg)



](/en/agence/akira-kamata)

[Akira](/en/agence/akira-kamata)22 July 2026

### [Making of : “La nuit des Losers”](/en/blog/making-of-la-nuit-des-losers)

lanuitdeslosers.ch, built fast: paper wireframes, a bold hand-drawn identity, then Claude Code to prototype and ship. A mouse-tracking hero animation, a bowling game made of sponsor logos, and a few bugs we’re keeping.

lanuitdeslosers.ch, built fast: paper wireframes, a bold hand-drawn identity, then Claude Code to prototype and ship. A mouse-tracking hero animation, a bowling game made of sponsor logos, and a few bugs we’re keeping.

[

![Making of : “La nuit des Losers”](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/wp/app/uploads/2026/05/La-nuit-des-Losers-Teaser-1-768x576.png)



](/en/blog/making-of-la-nuit-des-losers)

Author(s)

[

![Pierre](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2020/12/Pierre-300x300.jpg)



](/en/agence/pierre)

[Pierre](/en/agence/pierre)7 July 2026

### [Dark mode: necessity or trend](/en/blog/dark-mode-necessity-or-trend)

Nous faisons le tri entre idées reçues, réalités techniques et bonnes pratiques de design.

Nous faisons le tri entre idées reçues, réalités techniques et bonnes pratiques de design.

[

![Dark mode: necessity or trend](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/wp/app/uploads/2026/07/1-768x384.png)



](/en/blog/dark-mode-necessity-or-trend)
