I’ve used pihole for a while on an dedicated NanoPi Neo SBC, which was running a headless DietPi Installation. But never within a docker container. I’ve routed all the DNS traffic in my home network over it and it worked quite well, most of the time.
In the end, as there are several public DNS servers around that provide either DoH or DoT access, they also include content blocking, which is much easier to handle and one system less which needs to be maintained.
Cloudflare offers some, Mullvad DNS servers are available for everyone, no account needed. Quad9 includes adblocking by default, NextDns also offers some options.