Last active
March 9, 2017 16:33
-
-
Save ianlintner-wf/6413cecf6b603a61d04250950133fb87 to your computer and use it in GitHub Desktop.
Docker & Drupal Local Alias via seperate dockerized SSH Container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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, | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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