Run container in specific path on host

So sorry if this question has been asked before. Is it possible to run a container from a specific path on host? I.e. I am running a pi-hole container. I’ve noticed by default all containers run in /var/lib/docker. I’d like to isolate my containers in their own file space.I have allocated space on an array mounted on /pi-hole.

It is a yes and no answer. No to what you asked for, but yes for persistent data in bind volumes.

All container metadata and the overlay filesystem live underneath the docker data-root. You can move the data-root, if you want it to be somewhere else than /var/lib/docker, but you can’t do so for single containers. Though, this is not the location where persistent data of containers is stored (unless you use named volumes with default parameters).

You can bind mount a host path of your choosing as volume into a container path, to make it write persistent data into the host folder (as long as file ownership and permissions align with the needs of the container)

Check the bind mount doc. Standard use cases: mount host folders into the container for config files and log files.