I managed to get docker and the pihole image working on my pi with the following docker-compose file:
version: '3.6'
services:
pihole:
image: pihole/pihole:v5.8.1
container_name: pihole
restart: always
hostname: pihole
volumes:
- ./pihole/pihole/:/etc/pihole/
- ./pihole/dnsmasq.d/:/etc/dnsmasq.d/
#- ./pihole/log/:/var/log/ #This is not working for some reason, have to look into it.
cap_add:
- NET_ADMIN
environment:
- ServerIP=192.168.1.150
- TZ=Europe/Berlin
- PIHOLE_DNS_=1.1.1.1
- WEBPASSWORD=SomePassword #Replace this
network_mode: "host"
#Figure out a way to also add blocklists
Seems to work pretty good! But I am wondering if there is also a way to supply black, white and adlists directly in the docker-compose file somehow? This way it would be seamless to launch new containers, update and so on and not having to ad my domains manually everytime.
As it currently stands, I'm guessing the best solution is to have some script run some docker exec commands updating the underlying database.
A bit unfortunate that docker-compose up doesn't suffice at the moment.