Drush with a dockerized Drupal install
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