Drush with a dockerized Drupal install I'm trying to setup a development environment for Drupal using docker. 

I've already succeeded on creating a PostgreSQL container and a Drupal container using official images for both, and I can replicate the production environment. 

How do I get drush to detect my Drupal install?

I've tried both https://hub.docker.com/r/drush/drush/ and https://github.com/DockerDemos/appstack-drush (had to build that last one) but when I run drush inside the containers they don't see the Drupal install.

I run "docker run --volumes-from &lt;my-drupal-container&gt; --link &lt;my-db-container&gt;:postgres -it drush/drush dd" and it shows nothing, "drush cc" finds no caches.
There are 2 things you can do here:


Use Docker as external container like you are doing. You need to pass the --net parameter too to make that work, see example below. You will always use this drush container as a running command, not a container that is up and running with your stack all the time.


docker run --net={your_container_network_name} --rm -it -v $(pwd):/app drush/drush sqlc


Simply add drush to your Drupal container and connect to that container to run drush commands:


Dockerfile:

ENV DRUSH_VERSION 8.1.2
RUN curl -L --silent https://github.com/drush-ops/drush/releases/download/${DRUSH_VERSION}/drush.phar \
  &gt; /usr/local/bin/drush &amp;&amp; chmod +x /usr/local/bin/drush


Connect to your container and then run any drush command inside it:

docker exec -it {container_id} bash

root@{container_id}:/var/www/html# drush status