phpmyadmin docker 站点无法访问

phpmyadmin docker 站点无法访问

非常令人沮丧的错误。希望您能给我一些建议。

我删除了所有图像、所有容器,并使用 docker 进行了系统修剪。

然后,我运行以下命令。我知道我没有指定 mysql 主机和密码,但不管怎样,这仍然应该有效,或者显示我可以登录的 phpmyadmin 主页,并且应该显示 mysql 无法连接。

sudo docker run --name adminphp1 -d -p 8000:80 phpmyadmin/phpmyadmin

运行此命令后,查看容器列表,它显示以下内容:

389268e87d4b        phpmyadmin/phpmyadmin   "/run.sh supervisord…"   2 minutes ago       Up 2 minutes        9000/tcp, 0.0.0.0:8000->80/tcp   adminphp1

9000/tcp 从哪里来?

运行后docker logs adminphp1显示如下:

Complete! phpMyAdmin has been successfully copied to /var/www/html
/usr/lib/python2.7/site-packages/supervisor/options.py:461: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2019-04-11 15:15:09,745 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2019-04-11 15:15:09,746 INFO Included extra file "/etc/supervisor.d/nginx.ini" during parsing
2019-04-11 15:15:09,746 INFO Included extra file "/etc/supervisor.d/php.ini" during parsing
2019-04-11 15:15:09,756 INFO RPC interface 'supervisor' initialized
2019-04-11 15:15:09,756 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2019-04-11 15:15:09,756 INFO supervisord started with pid 1
2019-04-11 15:15:10,760 INFO spawned: 'php-fpm' with pid 21
2019-04-11 15:15:10,762 INFO spawned: 'nginx' with pid 22
[11-Apr-2019 15:15:10] NOTICE: fpm is running, pid 21
[11-Apr-2019 15:15:10] NOTICE: ready to handle connections
2019-04-11 15:15:11,826 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-04-11 15:15:11,827 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

然后我尝试通过 website.com:8000 访问它,经过一段时间的思考后,浏览器显示无法访问网站。

非常感谢您能提出任何建议。

答案1

我在本地尝试了 docker 命令,它对我有用。我可以在 访问 phpmyadmin localhost:8000

顺便问一下website.com:8000,您是在远程虚拟机中运行这个吗?如果是这样,防火墙设置可能会阻止访问,您需要允许流量到端口 8000。

相关内容