sending udp broadcast from a docker container

后端 未结 2 2005
甜味超标
甜味超标 2021-02-19 13:28

I\'m having a few docker containers (Using docker-compose and a single network - network-sol)

One of the containers is a Spring Boot application

相关标签:
2条回答
  • 2021-02-19 14:08

    I have gotten some luck out of this. The guide specifies sysctl parameters that are needed for broadcast forwarding from a docker network, you should then be able to either use his script or specify these parameters when running docker.

    0 讨论(0)
  • 2021-02-19 14:09

    You should either run the service defined in your docker-compose.yml file with network_mode: host.

    Alternatively you can publish the port of the container you intended to communicate with by publishing it using the following configuration. Note that the /udp is required for UDP communication to work.

    service:
      ports:
        - "8080:8080/udp"
    
    0 讨论(0)
提交回复
热议问题