Docker Post-Install Instructions -- Now What?

Hi, I've used pi-hole successfully on a raspberry pi for some years now, and now trying to run it in a Docker container on a used mac mini to try and simplify my hardware setup. I have some questions, and some notes from my process in case it proves interesting to anyone.

I read the prerequisites and followed the Docker - Pi-hole documentation successfully to start pi-hole in a container. I am new to Docker, so I researched some GUI options, and I am using a GUI called "OrbStack" on the mac mini.

I can see in the GUI that my pi-hole container is reachable via https://pihole.pihole.orb.local/ -- and indeed, if I put that into firefox, I can login to the dashboard.

I first tried to go to https://pi.hole from muscle memory but this did not resolve -- I realize now that the reason it didn't resolve was because the host computer was not yet set up to use pihole DNS.

I also see that the container's "IP address" is "192.168.107.2"

First Question: What is this 192.168.107.2 IP address? And how does it work? I tried pinging it from another device on my network, and the ping didn't go through. However, if I type it into firefox on the host mac mini, it resolves to the pihole container. Is it an IP address on a virtual network interface created by the Docker software which only exists within the host computer?

Ordinarily, if I were running pihole on a raspberry pi, I would follow the post-install steps to see if pihole is working on the local computer, and then try setting up other devices to use it.

If I go into the mac's network settings, and set the DNS to 127.0.0.1 and ::1, per the post-install steps (and I am guessing that it is appropriate to add ::1 for ipv6), then, indeed, the mac seems to use the pihole for DNS. In the client log, I see suspicious lookups from 192.168.107.1, 192.168.107.2, localhost and ::1 . For example, www.skjdhfjasdhk.shop and mobilewhack.us.intellitxt.com . Maybe these are from the pihole diagnosis script? Or just background undesirable lookups some software on the mac is doing?

Question: Does 192.168.107.1 correspond to the "host" Mac OS? Or something else?

Per the warning on the post-install steps page, if pihole fails in some way, I will need to change my DNS settings on the host mac OS to a working DNS provider in order to connect to the internet or repair pihole.

It looks like I can visit the mac mini's IP local address on from other devices on my LAN, and access the pihole admin dashboard from these other devices. So that implies to me that I'm good to go pointing the router or other devices to that mac mini's LAN IPv4 and IPv6 addresses.

Is there anything else I need to know about running pihole in a Docker and connecting from other devices in my home network?

Thank you for your patience with what must be basic questions. I followed the instructions in a different post and generated a debug token just in case: https://tricorder.pi-hole.net/J7qzdX7y/

Thank you in advance!

-P

EDIT: I have discovered that no matter which client is connecting, the Query Log always shows the IP address 192.168.107.1 . I suppose this is because all queries are routed through the host OS IP address before getting to the container via the virtual network interface.

Pi-hole doesn't define which IP will be used.

By default a container uses the machine IP. Even when we create a macvlan network (this is an advanced configuration - only possible on Linux) the process is the other way around: the user defines which IP will be used and then the IP is added to the compose file or docker run command.

If you don't know where this IP is coming from, you need to check how you started your container.

My guess is:

If i understood correctly, you are running Pi-hole on MacOS, not on Linux.

I never heard about "OrbStack" before, but apparently this GUI system runs the containers inside a Virtual Machine with a Linux OS (very similar to how the official Docker Desktop works).

This is also a guess, but this GUI probably created a network where the gateway is 192.168.107.1 and each container receives an IP from this network. This is the network connecting the VM and MacOS.

Your debug log confirms the container is using this IP and the gateway is 192.168.107.1:

*** [ DIAGNOSING ]: Network routing table
   default via 192.168.107.1 dev eth0 
   192.168.107.0/24 dev eth0 proto kernel scope link src 192.168.107.2 

Yes. The debug log randomly selects domains from the blocklists to check if blocking is correctly enabled. You don't need to worry about that.

I guess this is the IP used by the VM that runs docker. Check "OrbStack" documentation.

It is a lot simpler to run docker on Linux.

Running docker on MacOS or Windows requires a VM, which adds another network layer, making the configuration more complex. Also, you probably won't be able to see individual devices on the Dashboard (as you noticed, all queries will show up as coming from 192.168.107.1).

Thank you for this insight. I found some complexity just now by testing what happens in case of a power outage -- the pihole container does not auto-restart, and when I start it manually, it is no longer reachable via the network bridge. I will fall back to the raspberry pi running pihole which still works fine. Thank you :slight_smile:

Docker containers should restart (when configured to do it), but in your case it looks like issue is the whole OrbStack system and network.

Apparently you were able to simply the hardware setup, but not the software setup...

I suggest you to try docker again another time, but using a Linux machine.
At the moment, I think your Raspberry Pi will be simpler.