Skip to content

Instantly share code, notes, and snippets.

@ianlintner-wf
Last active October 6, 2016 14:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianlintner-wf/cb14a12c2c5bba26da18 to your computer and use it in GitHub Desktop.
Save ianlintner-wf/cb14a12c2c5bba26da18 to your computer and use it in GitHub Desktop.
Local Drush to Drupal Docker Client no SSH. Scripts for making a special Drush prompt that will run drush commands in the specified docker container.
export CONTAINER=drupal
export DRUSHROOT=/var/www/docroot
export SITEHOST=drupal.loc
alias drush="docker exec -it $CONTAINER drush --root=$DRUSHROOT -l $SITEHOST"
#Important must run with ". "!
#. scripts/drush-end.sh
PS1="${PS1/ \[$CONTAINER\] /}"
unset CONTAINER
unset DRUSHROOT
unset SITEHOST
unalias drush
#Put in a scripts folder in your drupal and run with source
#Important must run with ". "!
#. scripts/drush-start.sh drupal7 drupal.loc /var/www
export CONTAINER=$1
export SITEHOST=$2
export DRUSHROOT=$3
alias drush="docker exec -it $CONTAINER drush --root=$DRUSHROOT -l $SITEHOST"
$PS1="$PS1 [$CONTAINER]"
#Put in a scripts folder in your drupal and run with source
#Important must run with ". "!
#. scripts/drush-start.sh
export CONTAINER=drupal
export SITEHOST=drupal.loc
export DRUSHROOT=/var/www/docroot
alias drush="docker exec -it $CONTAINER drush --root=$DRUSHROOT -l $SITEHOST"
$PS1="$PS1 [$CONTAINER]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment