How do I run a docker command from a dind container

I need to run docker inspect on a docker host from a a docker container. I have already started with -v /var/run/docker.sock:/var/run/docker.sock and -v /var/lib/docker/: /var/lib/docker/ . My goal is to use the docker in docker container to monitor the other containers running on the host.


I believe you simply need to set DOCKER_HOST env var in the container.