Docker Mac lost connection to API

Expected Behaviour:
Docker installed on MacMini M1.
PiHole installed as per standard instructions
Expected PiHole to work

Actual Behaviour:
Webserver has several errors
"Lost Connection to API"
DNS Servioce not running
In PiHole diagnosis "FTL failed to start due to cannot access /etc/dnsmasq.d/sedtNaC6z: No such file or directory"

Debug Token:
https://tricorder.pi-hole.net/WcnQUiHY/

How did you create the container?
Are you mounting volumes/binds on the host filesystem?

Please, post the compose file or docker run command used to start your container.

After writing the previous answer I remembered I already saw similar cases.

Please, check this post:

You will probably need to use named volumes.

Hi. I fear this may be a newbie issue. I've run PiHole on Raspberry pis and a synology NAS via docker before, but this is my first time trying to use a Mac. I pretty much followed then instructions here:
https://www.imore.com/how-run-pi-hole-your-mac
I installed the Silicon version of Docker, but otherwise followed it exactly as written.
Compose:

version: "3"

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp"
      - "80:80/tcp"
    environment:
      TZ: 'Australia/Melbourne'
      WEBPASSWORD: 'Password'
    volumes:
      - './etc-pihole:/etc/pihole'
      - './etc-dnsmasq.d:/etc/dnsmasq.d'
    cap_add:
      - NET_ADMIN
    restart: unless-stopped

I started the container using the GUI of Docker on the Mac.
I know I've missed something but not sure what.
Thanks again for your quick reply.
John

I think I've sorted it, thanks to your advice.
For anyone that stumbles across this post, trying to run PiHole in Docker on a Mac:

  1. Install Docker from the website (in my case the silicon version)
  2. In the docker GUI create two volumes called dns_config and pihole_app.
  3. Then use command in terminal: (substituting your Mac IP, TZ and password)

docker run -d --name pihole -e ServerIP=192.168.4.100 -e TZ=Australia/Melbourne -e WEBPASSWORD=PASSWORD -e DNS1=1.1.1.1 -e DNS2=1.0.0.1 -p 80:80 -p 53:53/tcp -p 53:53/udp -p 443:443 -v pihole_app:/etc/pihole -v dns_config:/etc/dnsmasq.d --dns=1.1.1.1 --cap-add=NET_ADMIN --restart=unless-stopped pihole/pihole:latest

Can access PiHole via http://localhost/admin/index.php without errors.
Terminal command docker ps -a gives "healthy" response
NOTE: I did not need to create a "compose" file.

Thanks again!

Notes:

  • ServerIP variable is deprecated.
    Use -e FTLCONF_LOCAL_IPV4=192.168.4.100.

  • You don't need port 443. There is nothing inside the Pi-hole v5 container listening on this port.

  • You can use your docker run command. You don't need a compose file.
    They are just different ways to start a container.

Edited for my memories with your suggestions.

Thanks. working well now EXCEPT that I can't use the 192.168.4.100 address as a DNS server. In all other respect the PiHole is running. I made another post about it but no solution. I know it must be something simple.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.