Talking Drupal #158 - Local Development with Docker

February 5, 2018

In episode #158 we discuss using Docker for local Drupal Development





  • Call for DrupalCon Sessions Extended

  • Drupal 8.5 out March 7th
  • What is Docker
  • Contaniers
  • Docker and Vagrant
  • Getting Started with Docker
  • Use Cases



I've been messing with Docker for over a year and have not switched over yet, still using MAMP Pro. Honestly MAMP has always worked for me with more or less no problems. It can run any version of PHP (per site) and Apache or Nginx (per site). I am not sure why people are thinking MAMP is over.

Having said that it's nice to be able to have a docker-compose.yml file or a .lando.yml file in the repo and just tell new devs: "get the repo, then run docker-compose up -d (or lando start) and you're done" (almost). One issue is connecting to the database with Sequel Pro or whatever - finding or changing the host and port to use is one small hassle versus MAMP.

Also, with MAMP, all my local sites are running all the time. With Docker (of Lando) you have to start it for each site. Lando advantage is the "recipes" for D7, D8, WP, Pantheon, etc., and for Pantheon users nice to be able to "lando pull" to get a database and/or files from Pantheon dev, live or whatever.

One confusion I had with Docker is what do you need a Dockerfile for? Answer is you pretty much don’t. You only need to mess with Dockerfiles if you need an image that you cannot get from Docker Hub, and pretty much every image you would want is on Docker Hub. You just need a docker-compose.yml file that grabs the images you need. So, Dockerfile is for making images, Docker Compose is for using existing images in containers (nginx, php, mariadb, etc.).

One problem with Docker on Mac is syncing of files between host (Mac) and the containers is supposedly slow (I have not noticed that much) so you’re supposed to use docker-sync with it: So, another complication, at least for now.

If I move to Docker it will be with Lando: …it just works. The recipes are great and give you what you need, but you can easily add services to the .lando.yml file if you need other containers running. It syncs fast so you don’t have to mess with docker sync.

Thanks for the insight.

The link to "What is a Container" doesn't contain nothing. :)

(Nice podcast you have.)

Thanks for listening JL!   Link fixed. 

Add new comment