4. Using Host-Local Networking for Reflectors
Port-forwarding is suitable for situations where there are a limited number of port numbers needing to be forwarded, and those port numbers are known at the time the software is deployed. However, when deploying a static reflector, the ports which need to be forwarded from the container to the host are likely unknown at the time of deployment and may change as new channels are configured in the system.
In this case, when running a static reflector inside a Docker container, it is recommended to configure the container to run in host networking mode (--net=host). This makes the ICE Agent appear as though it were running natively on the host system with full access to the underlying system’s network hardware and eliminating a great deal of complexity.
Instead of using the -p argument to specify ports, when operating a static reflector, use host-local networking instead:
docker run --net-host ...