docker 中没有连接暴露和发布的端口 [英] No connection in docker with ports exposed and published
问题描述
我在 docker 容器中运行了一些中间件.
I have some middleware running in a docker container.
当我在我的主机上运行这个中间件时一切正常.
When I run this middleware on my host machine everything works fine.
当我在 docker 容器上运行它并公开和发布所有必要的端口时:
When I ran it on the docker container with all the necessary ports exposed and published:
Dockerfile:
Dockerfile:
EXPOSE 5672 15672 1337 1338 5556 3000
Docker-compose.yml
Docker-compose.yml
ports:
- "5672:5672"
- "15672:15672"
- "1337:1337"
- "1338:1338"
- "5556:5556"
- "3000:3000"
这很奇怪,因为我在那个图像中有rabbitmq 和mule.Rabbit 运行良好,因为我可以访问管理控制台并在其中发布我的 mule 应用程序.
It’s weird because I have rabbitmq and mule in that image. Rabbit works well beacause I can access the management console and my mule app publish in it.
我有一个流程,用一个石英组件在 rabbitmq 中发布,每 30 毫秒保持活动一次,并且运行良好.
I have a flow, that with a quartz component publish in rabbitmq a keep alive each 30ms, and works well.
但我还有其他流在 UDP 入站端点中接收信息并将其发布到 rabbitmq 队列.入站端点没有收到任何消息,此端点侦听 0.0.0.0 和端口 1338,而我正在绑定 1338:1338.
But I have other flow which receives information in an UDP inbound endpoint and publish that on a rabbitmq queue. The inbound endpoind doesn´t receive anything, this endpoint listens in 0.0.0.0 and port 1338, and I am binding 1338:1338.
因此,如果我在主机的 localhost:1338 上收到包,入站端点应该不会收到吗?
So if I receive packages on my localhost:1338 in my host machine, the inbound endpoint should receive it no?
也在其他流程中,我有一个 java 客户端套接字,它让我拒绝了连接.
Also in other flow I have a java client socket which gives me connection refeused.
奇怪的是,当我在主机上运行它时,这一切都没有发生,而在 docker 中,我公开并发布了端口.
The strange thing is that nothing of this happens when I run this on my host machine, and in docker I have the ports exposed and published.
谢谢大家
推荐答案
需要说明docker是udp协议.
Need to indicate docker it is udp protocol.
来自:
-1338:1338
致:
- 1338:1338/udp
这篇关于docker 中没有连接暴露和发布的端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!