Skip to content

Instantly share code, notes, and snippets.

@ianlintner-wf
Last active March 9, 2017 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianlintner-wf/6413cecf6b603a61d04250950133fb87 to your computer and use it in GitHub Desktop.
Save ianlintner-wf/6413cecf6b603a61d04250950133fb87 to your computer and use it in GitHub Desktop.
Docker & Drupal Local Alias via seperate dockerized SSH Container
$aliases['loc'] = array (
// This is the full site alias name from which we inherit its config.
'parent' => '@docker.loc' //alias name,
'uri' => 'docker.loc' //Drupal URL,
'root' => '/var/www/' //Drupal full path on disk,
'ssh-options' => '-p 2222',
'remote-host' => '192.168.99.100' //DOCKER/DOCKER MACHINE IP,
);
#Create an ssh container
#https://github.com/jeroenpeeters/docker-ssh
#$1 is the container name
#$2 is the port number e.g. 2222
#
# Run example: ./docker_ssh.sh drupal-docker 2222
#
SSHContainer="sshd-$1"
docker run -e CONTAINER=$1 -e AUTH_MECHANISM=noAuth \
--name $SSHContainer -p $2:22 --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
jeroenpeeters/docker-ssh
@ianlintner-wf
Copy link
Author

Creates a dockerized ssh into your drupal container. Put the config file with appropriate parameters in your ~/.drush folder

access via drush alias e.g.
drush @docker.loc status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment