Trying to run a Consul.io DNS server as a container under multi-container setup - cannot bind to 0.0.0.0:53 because dnsmasq in BalenaOS is listening on 127.0.0.2:53, so how do I get hold of the "local" IP Address?

Hey folks,

After spending a lot of time looking into DNS options from my last question, I’ve decided that Consul.io probably is the best fit for what I’m doing after all.

As a result, I’m now trying to launch Consul in one of my multiple containers, however when it tries to bind to an address it can’t because DNSMasq is listening on 127.0.0.2:53.

What I’d like it to do is bind instead to the “local” IP Address on the network which would instantly solve this issue, however I can’t see any environment variables that contain this information.

I’ve seen a few solutions on here that involve running a script to query the Supervisor API to get the IP back and then use it, however I’m trying to avoid building my own containers where possible to reduce support overheads so would rather not go down that route if I can avoid it.

Is there really not an env var that will allow me to do an equivalent of consul -bind=${BALENA_LOCAL_IP_V4_ADDRESS} from my docker-compose.yml?

Unfortunately, the use-case for this means that I won’t have prior knowledge of, or be able to dictate, the Local IP Address for the node, it will be “whatever the customer deems appropriate for their own network”.

Thanks in advance!