origamiofficial / docker-pihole-unbound

A supercharged Pi-Hole docker container with Unbound built-in. [Auto Updates 🚀]
https://hub.docker.com/r/rlabinc/pihole-unbound
MIT License
57 stars 5 forks source link

Docker Image migration query #21

Closed louis-manabat closed 9 months ago

louis-manabat commented 10 months ago

Hi @origamiofficial - hope you're doing well!

Firstly, thank you very much taking the initiative to get this up and running, the current docker tag has been bugging me and there hasn't been an update since late December :(

I am contemplating migrating over from the original pihole-unbound image due to it being abandoned for months aside from getting the occasional tag update. But want to cover my bases before I begin testing a back-up instance on my primary server (I have a Pi dedicated for running Pi-hole that runs gravity-sync onto a backup instance on my main server).

Namely the ports and environmental variables, if I were to replace the image from chriscrowe/docker-pihole-unbound to rlabinc/pihole-unbound, would the container spin up the same way? Mitigating the need to change anything else aside from the image name? I want to assume yes from a previous query regarding volumn mounting but wanted to make sure it would be the same, just with more support and whatnot!

Again, appreciate the initiative man!

origamiofficial commented 10 months ago

Hi @louis-manabat, thanks for your query. Have a look at #20. Also please note that this image supports all the environment variable same as official image and there is no need to change anything else aside from the image name for migration from chriscrowe's image till now. If you need anything else, let me know!

louis-manabat commented 10 months ago

Perfect! I'll definitely look into it then - thanks very much!

Edit: Apologies, didn't mean to reopen - fat fingered the button

louis-manabat commented 10 months ago

Hey @origamiofficial sorry, I have returned with an issue with the migration.

I was able to successfully migrate my backup instance over to your image, but for some reason, I wasn't able to with the pihole server. The issue seems to lie with pihole-FTL and it failing to start the DNS resolution.

2024-01-28T09:57:16.655579926Z s6-rc: info: service _postFTL successfully started 2024-01-28T09:57:16.656175363Z s6-rc: info: service legacy-services: starting 2024-01-28T09:57:16.685947442Z s6-rc: info: service legacy-services successfully started 2024-01-28T09:57:21.570942936Z s6-rc: info: service legacy-services: stopping 2024-01-28T09:57:21.576555052Z s6-rc: info: service legacy-services successfully stopped 2024-01-28T09:57:21.576860067Z s6-rc: info: service _postFTL: stopping 2024-01-28T09:57:21.879065498Z s6-rc: info: service _postFTL successfully stopped 2024-01-28T09:57:21.879898321Z s6-rc: info: service lighttpd: stopping 2024-01-28T09:57:27.125060667Z [✗] DNS resolution is currently unavailable

This was a previous issue with the pihole server with the other image, but the solution seemed to be adding the following to the compose file:

dns:
      - "127.0.0.1"

From what it seems, with or without the dns is still failing the service - any advice on what could be the issue?

Edit: A solution that was found here shows to add the hosts IP address to port 53 both tcp and udp. Is this something you might be aware of at the moment?

ports:
      - 192.168.X.X:53:53/tcp
      - 192.168.X.X:53:53/udp
origamiofficial commented 10 months ago

Hi @louis-manabat again, can you share the Docker command/compose you've used?

origamiofficial commented 10 months ago

@louis-manabat any update?

louis-manabat commented 10 months ago

Hi @origamiofficial - sorry been busy with work and forgot to get back to you.

I have it working at the moment with the following (omitting the unnecessary env portation)

version: "3.3"

services:
  pi-unbound:
    image: rlabinc/pihole-unbound
    container_name: ${CONTAINER_NAME:?error}
    hostname: ${PIHOLE_HOSTNAME:?error}
    ports:
      - "${PIHOLE_WEBPORT:-80}:80/tcp" # Allows use of different port to access pihole web interface when other docker containers use port 80
      - "192.168.20.201:53:53/tcp" # Had to add IPs here to make it work
      - "192.168.20.201:53:53/udp"
      - "67:67/tcp"
      - "443:443/tcp"
      # - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
    volumes:
      - type: bind
        source: ${PIHOLE_DIR_BIND:?error}
        target: /etc/pihole
      - type: bind
        source: ${DNSMASQ_DIR_BIND:?error}
        target: /etc/dnsmasq.d
    # dns:
    #   - "127.0.0.1" # This initially worked, but not anymore
    cap_add:
      - NET_ADMIN
    restart: always
origamiofficial commented 10 months ago

Instead of adding the IP in front of port, can you just simply put 53:53/tcp & 53:53/udp?

louis-manabat commented 10 months ago

Unfortunately no, what I currently have is the reason why it's able to run properly

origamiofficial commented 10 months ago

It seems I can't reproduce the issue on my end with both amd64 & armhf devices.

Here are some possible solutions:

  1. I would suggest you to check the DNS settings page Pi-hole settings > DNS tab and under the Upstream DNS Servers make sure the value of Custom 1 (IPv4) is set to 127.0.0.1#5335 and no other DNS servers are present.
  2. You may also have a quick look at Pi-hole's official docker repo for any changes they've done that can cause this issue. Note that this image supports all the environment variables same as the official one.
  3. If you're using Ubuntu or Fedora then check this.
  4. You can also try the official image to check if it works or not. If not then it is best to open a new issue in the official repo so that they can fix it.
origamiofficial commented 9 months ago

As there is no further communication, I'm closing this issue as solved!