Docker Link

I try to achieve the following:

  • have several docker containers that perform some tasks of the period
  • there is a component running on the local host that, among other tasks, manages (starts / stops) containers
  • from time to time, services in containers are performed; it is necessary to publish the result. Therefore, they bind to the open port using ZMQ and send the result.
  • The component running on localhost subscribes to a specific port and listens for what.

The problem is that each container requires a specific / different port on the local network to bind and publish the results. And that means that I need to listen on all ports of the container.

Is it possible to listen on one port, and all containers publish their work there?

If not, what are the options?

thank

+4
source share
2 answers

Try using ZMQ in the container, so the containers will publish the work in zmq_container, and with localhost you can also subscribe to the zmq_contaniner channel (using one port)

+5
source

Parameters:

  • Publish results for a central shared database (e.g. mysql or mongodb container) from all and read from there
  • Publish the results for central shared message queues (for example, the kafka container) from all and read from there. (kafka will be a more powerful solution for reliable real-time messaging)
+2
source

Source: https://habr.com/ru/post/1674571/


All Articles