How to run "pihole -g" when pihole is a container

There is no problem with Pi-hole Docker.

Your initial request was:

No need to do that:
Pi-hole already comes with a preconfigured cron job that does automatically update blocklists, as pointed out by jfb in post#2.