What will you learn
- Basic Docker concepts like containers and images
- How to run Docker containers
- Creating and managing sets of containers using Docker Compose
- Creating Docker images from scratch to meet specific requirements
- Modifying existing Docker images
- "Dockerizing" an existing project
- Integrating external services such as databases, caching systems, and search engines
- Using Docker Hub, and automated builds for Docker images on Docker Hub
Overview
Docker is an efficient way to host Drupal applications that allows for the creation of consistent, isolated development environments that streamline testing, deployment, and collaboration, enhancing efficiency and reducing the "it works on my machine" problem.
In this guide, we introduce Docker, a container runtime that allows you to run pre-packed, sandboxed Linux applications anywhere. We'll start by running a single container on the command line, build up to running Drupal in Docker, cover how to build your own containers, and how to add Docker to your Drupal development workflow.
In these tutorials, we'll assume you're familiar with the basics of using the command line, including how to enter and run commands. (You can review our Command Line Basics course if you need to brush up.) A familiarity with Drupal development practices and Linux is helpful but not required.
The tutorials in this guide were authored by Tess Flynn. Tess, also known as socketwench, is a devops engineer who has worked with Drupal for over a decade. She is the author of the Flag module for Drupal and has given sessions at DrupalCons and DrupalCamps throughout the world on Drupal development, Docker, and DevOps.
Note: If you are just looking for a Docker-based local development environment solution for Drupal, we recommend using DDEV.
Courses in this guide
Docker basics
This course covers the basics of Docker, including understanding containers and images, installing Docker, and running containers interactively and in detached mode. Learners will also explore advanced topics such as using Docker Compose to manage sets of containers, configuring bind volumes and environment variables, exposing ports, and importing/exporting databases.
Customize Docker images
This course covers the basics of building custom Docker images, adding files and installing applications within containers, and configuring applications to run optimally. Learners will also explore advanced topics such as setting custom entry points, customizing existing images, and ensuring container security.
Using Docker in a development workflow
This course covers the essentials of using Docker in your daily workflow, including setting up an existing project to use Docker,, creating and configuring Docker-specific settings, and optimizing workflows for multi-client and multisite Drupal installations. Additionally, learners will explore advanced topics such as using external services, sharing containers with teams, automating builds, and managing Docker in production environments.