#Installing Drupal 8 with Docker
First, create and enter a directory on your host machine to act as a project root:
mkdir -p ~/Sites/drupal8 && cd $_
Then, execute the following line to use Composer to install the Drupal 8 files with correct permissions into a www subdirectory of your project root:
docker run --rm -v $PWD/html:/var/www/html composer create-project drupal-composer/drupal-project:8.x-dev /var/www/html --stability dev --no-interaction
When the Composer execution completes, your host machine should now contain a directory with Drupal source files at ~/Sites/drupal8/html.
Start MySQL container:
docker run --rm -p 33061:3306 -v ~/Sites/drupal8/datadir:/var/lib/mysql -e MYSQL_ALLOW_EMPTY_PASSWORD=true --name mysql mysql
Then start the PHP container, linking the volume and MySQL container:
docker run --rm -v ~/Sites/drupal8/html:/var/www/html --link mysql --name phpfpm php:7-fpm
Then run the nginx container:
docker run --rm -p 8001:80 -v ~/Sites/drupal8/html:/var/www/html --name web --link phpfpm nginx:drupal