Docker Windows Server 2016:如何仅在主机上显示容器 [英] Docker Windows Server 2016: how to have container visible on host only
本文介绍了Docker Windows Server 2016:如何仅在主机上显示容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要的容器只能用于虚拟网络上的主机。它适用于Windows Server 2016.
I have containers that I want visible only for the host on a virtual network. It's for a Windows Server 2016.
示例:
- 我有一个暴露端口27017的Mongo容器
- 容器地址是192.168.0.1
- 主机地址是XYZA
=>我希望Mongo只能在192.168.0.1:27017上访问。
=> I want to have Mongo reachable only on 192.168.0.1:27017.
如果我为我的容器使用docker NAT网络,可以在所有接口上访问Mongo(即XYZA:27017可见) 。
If I use a docker NAT network for my container, Mongo is reachable on all interfaces (i.e. X.Y.Z.A:27017 is visible).
顺便说一下,这个命令在windows上不起作用:
By the way, this command does not work on windows:
docker run 127.0.0.1:27017:27017 ...
感谢您的帮助。
推荐答案
问候,
我不能在我身边重现这个问题。你介意运行docker network ls吗?
I cannot reproduce this issue by my side. Would you mind to run docker network ls?
这篇关于Docker Windows Server 2016:如何仅在主机上显示容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文