如何让Adminer使用Docker在本地运行 [英] How to get Adminer to run locally using Docker

查看:59
本文介绍了如何让Adminer使用Docker在本地运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地主机上运行Adminer时遇到问题.运行此命令后:

I am having issues with running Adminer on my localhost. After running this command:

$ docker run --rm -ti --network host adminer
[Sun Jan 10 18:19:33 2021] PHP 7.4.14 Development Server (http://[::]:8080) started

我希望看到Adminer在localhost:8080上运行,但是我的浏览器无法在localhost:8080建立与服务器的连接"

I expect to see Adminer running on localhost:8080, however my browser "can't establish a connection to the server at localhost:8080"

不确定如何从此处继续.我的终端指出服务器正在8080上运行

Not sure how to proceed from here. My terminal states that the server is running on 8080

谢谢!

推荐答案

如果您必须在虚拟机上运行docker,那么我认为它只是在侦听该VM上的端口8080(您可以使用wget或curl检查该端口)您应该可以在docker桌面上找到的VM IP地址,或者可以使用VM控制台并在http://localhost:8080上尝试wget或curl)

If you have to run docker on a virtual machine then I think it's only listening to port 8080 on that VM (which you could check with wget or curl on the VM IP address which you should be able to find using the docker desktop, or you could use the VM console and try wget or curl on http://localhost:8080)

您可能需要使用 -p 8080:8080 而不是-network host 来公开本地计算机上的端口.

You may need to use -p 8080:8080 instead of --network hostto expose the port on your local machine.

这篇关于如何让Adminer使用Docker在本地运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆