No connection in docker with ports exposed and published

青春壹個敷衍的年華 提交于 2020-12-12 05:39:41

问题


I have some middleware running in a docker container.

When I run this middleware on my host machine everything works fine.

When I ran it on the docker container with all the necessary ports exposed and published:

Dockerfile:

EXPOSE 5672 15672 1337 1338 5556 3000

Docker-compose.yml

ports:
- "5672:5672"
- "15672:15672"
- "1337:1337"
- "1338:1338"
- "5556:5556"
- "3000:3000"

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.

I have a flow, that with a quartz component publish in rabbitmq a keep alive each 30ms, and works well.

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.

So if I receive packages on my localhost:1338 in my host machine, the inbound endpoint should receive it no?

Also in other flow I have a java client socket which gives me connection refeused.

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.

Thanks everyone


回答1:


Need to indicate docker it is udp protocol.

FROM:

-1338:1338

TO:

- 1338:1338/udp


来源:https://stackoverflow.com/questions/55857560/no-connection-in-docker-with-ports-exposed-and-published

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!