Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to run the docker image. Not able to login into localhost or adminer or the container through ssh #8

Open
learnbay-kiran opened this issue Aug 14, 2018 · 9 comments

Comments

@learnbay-kiran
Copy link

docker run -i -t -p 80:80 ricardoamaro/drupal8
**** MySQL data found on /var/lib/mysql/ ****
**** /var/www/html/web/index.php found ****
grep: /var/www/html/web/sites/default/settings.php: No such file or directory
Failed to create database: ERROR 2002 (HY000): Can't connect to local MySQL server through socket [error]
'/var/run/mysqld/mysqld.sock' (2)
Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more [error]
functional Drupal environment to run this command.
The drush command 'en memcache' could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This may occur when Drush is trying to:

  • bootstrap a site that has not been installed or does not have a configured database. In this case
    you can select another site with a working database setup by specifying the URI to use with the --uri
    parameter on the command line. See drush topic docs-aliases for details.
  • connect the database through a socket. The socket file may be wrong or the php-cli may have no
    access to it in a jailed shell. See http://drupal.org/node/1428638 for details.

Drush was attempting to connect to:
Drupal version : 8.5.6
Site URI : http://default
PHP executable : /usr/bin/php
PHP configuration : /etc/php/7.2/cli/php.ini
PHP OS : Linux
Drush script : /.composer/vendor/drush/drush/drush.php
Drush version : 8.1.17
Drush temp directory : /tmp
Drush configuration :
Drush alias files :
Drupal root : /var/www/html/web
Drupal Settings File : sites/default/settings.php
Site path : sites/default

------------------------- GENERATED USERS CREDENTIALS ----------------------------------

DRUPAL:  http://172.17.0.2              with user/pass: admin/admin

MYSQL :  http://172.17.0.2/adminer.php  drupal/Ooj3buo6iv6o or root/Naithaa2waNg
SSH   :  ssh [email protected]            with user/pass: root/Naithaa2waNg

Please report any issues to https://github.com/ricardoamaro/drupal8-docker-app
USE CTRL+C TO STOP THIS APP

------------------------------ STARTING SERVICES ---------------------------------------
2018-08-14 05:56:36,367 INFO success: mysqld entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2018-08-14 05:56:37,368 INFO exited: mysqld (exit status 0; expected)
2018-08-14 05:56:38,371 INFO spawned: 'mysqld' with pid 3181
2018-08-14 05:56:39,692 INFO success: mysqld entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2018-08-14 05:56:40,749 INFO exited: mysqld (exit status 0; expected)
2018-08-14 05:56:41,752 INFO spawned: 'mysqld' with pid 3607
2018-08-14 05:56:43,020 INFO success: mysqld entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2018-08-14 05:56:44,057 INFO exited: mysqld (exit status 0; expected)
2018-08-14 05:56:45,060 INFO spawned: 'mysqld' with pid 4478
2018-08-14 05:56:46,332 INFO success: mysqld entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

@n00b21337
Copy link

I have the same issue

Failed to create database: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

@inouiw
Copy link

inouiw commented Oct 12, 2018

I get the same error, but I can login with SSH as follows (note the ssh port is mapped with -p):
docker run -i -t -p 80:80 -p 8022:22 ricardoamaro/drupal8
The output shows the ssh password under "GENERATED USERS CREDENTIALS".

In another shell, connect to the docker image with
ssh root@localhost -p 8022

@inouiw
Copy link

inouiw commented Oct 12, 2018

Should be fixed with #10

@meetinthemiddle-be
Copy link

Same issue here but the fix in #10 isn't working for me either

@jptillman
Copy link

Broken for me, as well. #10 has been sitting idle since Oct. 2018 and can't be tested due to pull access permissions problems. It seems that fixing this isn't a priority for the maintainers.

@ricardoamaro
Copy link
Owner

Is this still happening? If it is what OS are you using?

@ricardoamaro
Copy link
Owner

ricardoamaro commented Jun 18, 2019

Just tested the latest version and seems to be working fine

$ docker run -i -t -p 80:80 ricardoamaro/drupal8
**** MySQL data found on /var/lib/mysql/ ****
**** /var/www/html/web/index.php found  ****
Starting Drupal installation. This takes a while. Consider using the --notify global option.                                [ok]
Installation complete.                                                                                                      [ok]
Congratulations, you installed Drupal!                                                                                      [status]
memcache was enabled successfully.                                                                                          [ok]
The following extensions will be enabled: memcache

------------------------- GENERATED USERS CREDENTIALS ----------------------------------

    DRUPAL:  http://172.17.0.2              with user/pass: admin/admin

    MYSQL :  http://172.17.0.2/adminer.php  drupal/redacted or root/redacted
    SSH   :  ssh [email protected]            with user/pass: root/redacted

  Please report any issues to https://github.com/ricardoamaro/drupal8-docker-app
  USE CTRL+C TO STOP THIS APP

------------------------------ STARTING SERVICES ---------------------------------------
2019-06-18 22:45:57,280 INFO daemonizing the supervisord process
2019-06-18 22:45:57,281 INFO supervisord started with pid 16
2019-06-18 22:45:58,283 INFO spawned: 'httpd' with pid 45
2019-06-18 22:45:58,284 INFO spawned: 'sshd' with pid 46
2019-06-18 22:45:58,286 INFO spawned: 'memcached' with pid 47
2019-06-18 22:45:58,287 INFO spawned: 'mysqld' with pid 48
2019-06-18 22:45:59,561 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-06-18 22:45:59,561 INFO success: sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-06-18 22:45:59,561 INFO success: memcached entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-06-18 22:45:59,561 INFO success: mysqld entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Note that this project has had more attention on gitlab

@leofachini
Copy link

leofachini commented Dec 19, 2019

@ricardoamaro if I do as you say, things work fine.
But when I tried do build docker imagem locally or from git as the READ.ME says I can't connect to localhost.

@ricardoamaro
Copy link
Owner

Could you please give more details please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants