24 Sep 2020, 00:00

Running pihole in a docker-container

Share

Getting ipv6 to work with rpi, docker and pihole

This is how I made pihole run in a docker container with ipv6 support.

Step one: Configure docker for ipv›6:

1
2
3
4
5
$ cat /etc/docker/daemon.json
{
        "ipv6": true,
        "fixed-cidr-v6": <your-ipvc-cidr>
}

then we need to create a ipv6 network for docker:

1
docker network create --ipv6 --driver bridge --subnet "fd01::/64" ipv6

restart docker

1
systemctl restart docker

I use docker-compose to manage the container, so I added the following to docker-compose.yml

1
2
      ServerIPv6: <this is the ip of your rpi host>
      IPv6: "true"

and choose the ipv6 network:

1
2
3
4
networks:
  default:
    external:
      name: ipv6

rebuild the docker container:

1
$ docker-compose up -d --no-deps --build pihole

And voila! The pihole instance should now come up with an valid ipv6 address - and should respond to DNS queries on the ipv6 interface.