[英]How to access Linux Docker Container's TCP Port from windows 10 host
I have installed Docker for windows on windows 10 . 我在Windows 10上安装了Docker for windows。 I am running Linux containers on docker.
我在docker上运行Linux容器。 I have a python app which has ZeroMQ which has a zmq server listening on port 3000 .
我有一个python应用程序,它有ZeroMQ,它有一个zmq服务器侦听端口3000。 I want to send images from my c# app deployed on windows host to connect to the zmq app running on docker linux containers and send images through tcp using zeromq .
我想从我在Windows主机上部署的c#app发送图像,以连接到在docker linux容器上运行的zmq应用程序,并使用zeromq通过tcp发送图像。 I am unable to access the container tcp port from windows app .
我无法从Windows应用程序访问容器tcp端口。 Please advise .
请指教 。
I tried the below: 我试过以下:
C:\Windows\system32>docker run -p 3000:3000 server-zmq10 docker:
Error response from daemon: 来自守护程序的错误响应:
driver failed programming external connectivity on endpoint condescending_kilby
(fc383d60832ae98a5601ba62e215a4033936f74b64577ca6b14f7c47f1f27f9a): Error starting
userland proxy: mkdir /port/tcp:0.0.0.0:3000:tcp:172.17.0.2:3000: input/output error.
Python code: Python代码:
context = zmq.Context()
socket = context.socket(zmq.REP)
print('Binding to port 3000')
socket.bind("tcp://127.0.0.1:3000")
I have done on the DockerFIle when creating the image: 我在创建图像时已经完成了DockerFIle:
EXPOSE 3000
Is there anything else which is required here ? 这里还有什么需要的吗?
After exposing 3000 port is there any service running for listening? 暴露3000端口后是否有任何服务正在运行侦听?
or use -p 5000:5000 in docker run command 或者在docker run命令中使用-p 5000:5000
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.