How to get the IP address of the docker host from inside a docker container

后端 未结 24 1945
鱼传尺愫
鱼传尺愫 2020-11-22 06:41

As the title says. I need to be able to retrieve the IP address the docker hosts and the portmaps from the host to the container, and doing that inside of the container.

24条回答
  •  生来不讨喜
    2020-11-22 07:19

    Maybe the container I've created is useful as well https://github.com/qoomon/docker-host

    You can simply use container name dns to access host system e.g. curl http://dockerhost:9200, so no need to hassle with any IP address.

提交回复
热议问题