Docker container config on startup

With 4.x we had the ability to provide lists in text files for adlists, blacklists, whitelists, etc which could be mounted into the Docker container (or in my case, a Kubernetes pod) on startup, allowing us to practice 'configuration as code'. With 5.0 disposing of list files, will this still be possible? If so, how?

1 Like


Apologies for the delay in response, please remember we are all essentially volunteers on this project with pretty busy schedules in "real life", so sometimes it can be a while before we get to things.

There is currently some refactoring work going on with the 5.0 docker image

I'm not sure that this has been thought about just yet, but please follow the development of that branch to stay up to date.

1 Like

Hi - totally understand, and thanks for replying. For context, here is how I run Pi-Hole: Highly-Available, Stateless Pi-Hole with microk8s | by Tim Webster | Medium

The ability to configure it with code is a killer feature, and all made possible by all the great work you guys have done with the Docker image! Just hoping this continues to be the case.

1 Like

This applies to me too as I'm quite interested in the idea of deploying Pi-Hole as a stateless container.

Currently I build my own image by taking pihole/pihole:v4.4 and adding an adlist file with COPY adlists.list /etc/pihole/adlists.list. This has worked very well for a long time. The container reads the file on startup and fetches the right lists into the Gravity database.

Until a few days ago this worked for the pihole/pihole:beta-v5.0 container too, but in the past few days it has stopped working. I understand that the only reason this worked in the first place is due to a "migration" feature where v5.0 is able to "import" the old format lists from v4, and that this feature might go away eventually, but nonetheless doing it this way worked well for now.

As you can see from above, the container does correctly find and identify the ad-lists in my adlists.list file, but then in the "Preparing new gravity database" step, it goes on to pull in only the default lists anyway.

I've looked through the beta branches for both Pi-Hole and for the Docker Container on GitHub and I can't identify any recent commits which might obviously have broken this import step.

It's my understanding that this change might also break upgrades for users of the :v4.4 Docker container who want to migrate to :v5.0. This is something which might come as a surprise for some users, as the official README for the Pi-Hole container seems to suggest running Pi-Hole with the :latest tag.