1

I have a standard Laradock setup. One is specifically for Drupal 8 development and I've installed the Drupal console fine such that it can be run from anywhere within the workspace container.

I am now trying to get the drush command to do the same. Drush is installed correctly but everything I've tried for adding the drush executable path to the .bashrc path doesn't seem to be working.

I have specifically been following the article at: Updating PATH environment variable permanently in Docker container but unsuccessfully.

Currently I have setup an environment variable in the laradock .env file as follows:

PROJECT_PATH_TO_VENDOR_DRUSH="/var/www/example_website/public_html/vendor/drush/drush"

Then within the Dockerfile for the workspace I have added the line:

ENV PATH "${PATH}:${PROJECT_PATH_TO_VENDOR_DRUSH}"

I then rebuild via the command docker-compose build workspace, bootstrap and then bash into the workspace.

Reviewing the content of the ~/.bashrc reveals nothing though. If I run manually export PATH=$PATH:/var/www/example_website/public_html/vendor/drush/drush everything then works fine, but this obviously disappears when I restart the container at any stage.

Could someone point out where I've gone wrong pleasE?

Many thanks John

John Cogan
  • 1,034
  • 4
  • 16
  • 39
  • You can do several things, but easiest I think is restart container with `docker run -e PATH=$PATH:/var/www/example_website/public_html/vendor/drush/drush` option – Alejandro Galera Jul 11 '18 at 08:17
  • Hi Yea I appreciate that would work but would a developer getting the LaraDoc config we have on git know to add that or what the path was to be. I was hoping for a way that didnt require a new dev having to do anything and simply run the container preconfigured\ – John Cogan Jul 11 '18 at 10:31

0 Answers0