Couldn't connect to Docker daemon - you might need to run docker-machine start default. Any help would be appreciated. I am on a mac with.
There are a lot of different ways to setup a local development environment, and there are usually many challenges along the way. One problem that often arises is that a developer’s local environment differs from their co-workers and/or their staging or production environments. For example, maybe you’re running PHP 5.6, your colleague is running PHP 5.5, and production is running PHP 5.4. This can cause issues when you share or deploy code that works in one environment but not in another. Using Docker, Docker Compose, and Bowline we can remove this pain point by ensuring that all of the environments are the same.
First off: what are Docker, Docker Compose, and Bowline?
- Docker is “an open-source project that automates the deployment of applications inside software containers.” Essentially, Docker runs a processes from within a container that includes all dependencies the process needs to run. This allows containers to run almost anywhere. For example, you may have a container for running MySQL.
- Docker Compose “allows you to define an application’s components – their containers, configuration, links and volumes – in a single file. Then a single command will set everything up and start your application running.” For example, you may use Docker Compose to bundle a web server container and a MySQL container.
- Bowline is a “Drupal focused docker container helper that ties everything together.” Bowline can be used to easily create a standard, local Drupal development environment for you by building the requisite Docker containers and configuring your settings. By default, Bowline creates two containers: mysql 5.5 and a web container that provides apache, php 5.4, and related software.
By using these tools, you can ensure that each member of your team has the same local setup. That way, if code works in one environment, then it works in all of them.
Now I’ll go through the steps I followed to set everything up on my Mac. For this tutorial I’ll be showing you how to set up a fresh Drupal 8 install, however you can also use these tools on new or existing Drupal 6 and 7 projects.