I'm starting to use Docker containers to instantiate local development environments, especially for WordPress and Drupal.
Two tools that I use a lot in my workflow are wp-cli and drush. Following the Docker philosophy, I leave the database in one container, the CMS in another (linked to bd with --link
), and the CLI tool in a third container (connected to bd with --link
and using CMS folders with --volumes-from
).
I can open containerized Drupal in the browser .
The installation screen appears, I enter the connection parameters and the installation completes successfully. It seems to me that Drush is that, for some reason, it gives error in the time to access the other containers.
In theory, it should work. In practice, it's only working pro wp-cli. It turns out that it has already worked for drush, and I can not, by any means, remember what I did differently so that it would stop working.
How do I instantiate the containers
WordPress:
Drupal: link
Drush error message
Unable to load class Drush\Sql\Sql [error]
exception 'Drush\Sql\SqlException' with message 'Unable to find a matching SQL Class. Drush cannot find your database connection details.' in [error]
/usr/bin/drushes/drush-8.1.3/commands/sql/sql.drush.inc:588
Stack trace:
#0 /usr/bin/drushes/drush-8.1.3/commands/sql/sql.drush.inc(455): drush_sql_get_class()
#1 [internal function]: drush_sql_cli()
#2 /usr/bin/drushes/drush-8.1.3/includes/command.inc(373): call_user_func_array('drush_sql_cli', Array)
#3 /usr/bin/drushes/drush-8.1.3/includes/command.inc(224): _drush_invoke_hooks(Array, Array)
#4 [internal function]: drush_command()
#5 /usr/bin/drushes/drush-8.1.3/includes/command.inc(192): call_user_func_array('drush_command', Array)
#6 /usr/bin/drushes/drush-8.1.3/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#7 /usr/bin/drushes/drush-8.1.3/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#8 /usr/bin/drushes/drush-8.1.3/drush.php(12): drush_main()
#9 {main}