Create basic server using Docker I am trying to work out how to create a Drupal dev environment using Docker.  I am trying to use the Docker containers for Drupal (https://hub.docker.com/r/library/drupal/) and MySQL (https://hub.docker.com/r/library/mysql/) to set up a Drupal server.

I am assuming that I need to link the MySQL container to the Drupal container.  I have created a docker-compose.yml file which seems to run fine on docker-compose up (I am using a Mac).

docker-compose.yml file:

drupal:
  image: drupal
  ports:
   - "8080:80"
  links:
   - db
db:
  image: mysql
  environment:
    MYSQL_ROOT_PASSWORD: mysql
    MYSQL_DATABASE: drupal
    MYSQL_USER: drupal
    MYSQL_PASSWORD: drupal
    MYSQL_ALLOW_EMPTY_PASSWORD: yes


After docker-composer completes, I can access the Drupal site from my web browser.  The Drupal installation works up to the point where I have to enter the database details.  At this point it fails:
Make sure to put in the "Host" of the MySQL database under "Advanced Configuration" as db and not the default localhost.