How to get the info of other containers in the container?

On the docker host, we can use the “docker inspect” to collect the info of running containers, but how to do it in the bootstrap script for a container?

Usually, you don’t. You can in principle publish the Docker socket into the container, but that’s an awfully powerful hammer.

What bit of information are you actually trying to find?