How can I run pi-hole on docker container

Hello Pi-Hole Team,

You are doing an amazing job with the pi-hole.

I have a question as to how can I run pi-hole on a docker container?

So far I was able to host the pi-hole on a macvlan so that I can assign host network to the pi-hole.

However, it wouldn't let me connect to it as I need to have password specified.

If I am hosting docker-compose.yml file on linux vm then I can.

But the way I am doing using macvlan it won't, since it's getting image pihole/pihole:latest directly.

So is there a way I can modify the password?

┌──(kali㉿kali)-[~/pihole]

└─$ sudo docker run -itd --rm --network newpihole \

--ip 10.5.5.106 \

--name pihole pihole/pihole:latest

c562ff90*********************************c7e0b43772986a014f695245612419

Regards,

Have a look at our Quick Start sample configuration, and apply that together with the Recommended Environment Variables.

Thank You for the link.
I was able to get it to work using
sudo docker exec -it pihole -a -p

Note:

You can also use the environment variable: WEBPASSWORD
(explained on the link posted by Bucking_Horn above).