访问Windows主机上的docker容器URL
警告#1:我已经阅读了
this answer,this answer和一个miriad其他答案/帖子,我仍然无法让它工作.
警告#2:我是码头工的新手,所以我可能会错过一些非常简单的东西. 我在Windows上运行Docker,运行this ELK image,我使用此命令启动: sudo docker run -p 5601:5601 -p 9200:9200 -p 5000:5000 -it --name elk sebp/elk 我正在尝试从Windows上运行的浏览器访问端口5601和9200,并且我一直在连接超时.这就是我所做的: >我相信docker run命令(上面)已经将端口5601和9200从容器转发到docker主机(boot2docker VM),所以应该没问题. 我错过了什么? 解决方法
实际上在Windows中将会运行一个Ubuntu VM,最重要的是只有你的容器被托管,所以只有你不能直接访问它
即使我遇到同样的问题,我按照以下步骤解决了我的问题 1. Enabled routing as told in the above post 2. Added a port forwarding from windows host to Ubuntu host where the containers are hosted by using below command netsh interface portproxy add v4tov4 listenport=4422 listenaddress=192.168.1.111 connectport=3128 connectaddress=192.168.0.33 a. Here 192.168.1.111 is my windows host ip address and 4422 is the port to where other machines in same network will call b. Here 192.168.0.33 is the ubuntu host where containers are hosted and 3128 is the ubuntu host port which is mapped to the container $docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 090af3e0c7a4 sameersbn/squid:3.3.8-5 "/sbin/entrypoint.sh" 6 hours ag o Up 5 hours 0.0.0.0:3128->3239/tcp squid 3. Then I added firewall to unblock inbound and outbound traffic for 4422 port in my windows host 现在我能够从网络中的任何系统访问容器:) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- windows-installer – 为什么枚举安装的MSI包这么
- windows – PE格式,IAT目录有什么用
- Cryptoapi签名/验证无法在Windows 8.1上运行
- Windows – 如何处理Lync 2010客户端更新
- 在Windows服务器上的相同界面上回复
- 将dll文件嵌入exe程序
- windows-mobile – Visual Studio 2010中的智能设
- 重新安排WPF中的ListBox项目(如Windows 8启动屏幕
- windows-vista – 如何在Windows Vista Home Edi
- windows-server-2003 – 为什么Windows Server 2