从主机访问docker容器的localhost

时间:2016-05-24 15:37:20

标签: docker localhost port containers

我按照this page的说明运行cloudera docker quickstart图像(在Windows上)。

我使用以下方式运行:

docker run --hostname=quickstart.cloudera --privileged=true -t -i -p 7180:7180 -p 9080:9080 cloudera/quickstart:latest

运行正常,我可以运行cloudera管理器并使用url http://192.168.99.100:7180访问它。到现在为止还挺好。我也在同一容器中的localhost:9080上使用tomcat和一个简单的应用程序。如何在我的主机上访问它?我尝试使用http://192.168.99.100:9080,但它不起作用。

更新:我使用vm ip修复了它,即192.168.99.100而不是服务器的localhost。现在它有效。感谢。

0 个答案:

没有答案
相关问题