Skip to content

issues with running multiple instances on a machine #726

@gklanderman

Description

@gklanderman

Versions

  • Pi-hole: v5.2.1 (Latest: v5.2.1)
  • AdminLTE: v5.2.1 (Latest: v5.2.1)
  • FTL: v5.3.2 (Latest: v5.3.2)

Platform

  • OS and version: Raspbian GNU/Linux 10 (buster)
  • Platform: RPi 2b+

Expected behavior

Hi, I am trying to run multiple instances of pi-hole in docker on a Raspberry Pi. I have configured several IP addresses for eth0 using virtual interfaces eth0:[0..4]. I am using network=host mode.

I have been able to work around all the issues encountered, however, this is not ideal as one of the issues in particular requires scripting in the run script, meaning that docker restarts will not work.

For the other issues, it would be much cleaner to have options to support this use case.

  1. The biggest problem is that setup_lighttpd_bind in docker-pi-hole/bash_functions.sh unconditionally binds the localhost interface when using '--net=host' mode, i.e.:
    $SERVER["socket"] == "127.0.0.1:80" {}
    This can be worked around in the run script by running a 'docker exec' script after 'docker run' to wait until /etc/lighttpd/lighttpd.conf has been re-written, then remove that line, and restart lighttpd. However, this means that the normal docker restart mechanism will not be able to restart the container. So the simplest fix is adding an option to bind only the ServerIP. Issue [Feature Request]: Docker environment variable to specify IP lighttpd should bind on #398 is related, and asks for a way to specify an IP address for lighttpd to bind (different from ServerIP); this would also solve the problem.

  2. Additionally, lighttpd always listens on all IPv6 addresses, i.e. (:::80), ignoring ServerIPv6, as documented in Issue setup_lighttpd_bind needed for IPv6 #163 and Issue lighthttp listens on all IPv6 addresses #239 There is a pull request If provided lighttpd will bind to ServerIPv6 in host mode #543 to resolve these which should also solve the issue here. Thankfully I do not need IPv6 and just turned it off with '-e IPv6="false"'.

  3. Next, dnsmasq always binds all interfaces; see Issue dnsmasq binds to all interfaces even if you specify a listen interface #491. We need an option to add the following to 01-pihole.conf:
    listen-address=$ServerIP
    bind-interfaces
    this could be the same option as used for item 1 above. I am able to work around this by adding those lines manually to /etc/dnsmasq.d/02-custom.conf which seems to be preserved across restarts. However, see item 4 below.

  4. Finally, forcing dnsmasq to only bind to the $ServerIP in item 3 above results in the HEALTHCHECK failing. This can be overridden using the 'docker run' options --health-cmd and related --health-* options but is not ideal.

I can probably fix at least some of these and send pull request(s), if you are actually willing to accept them. Given pull request #543 has not been merged in a year+, I'm not sure it is worth my time to send patches that will not be acted upon.

If you are interested in my working on fixes for these issues, is there a document that explains how to build the docker image from my local git repo and use it locally?

thank you!
Greg

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationnever-staleUse this label to ensure the stale action does not close this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions