How to get the IP of the host in the docker container and connect to a service of the host

  docker, question

How to Get Host IP in docker Container

For example, ruby services hosted by hosts may be used in nginx containers

The host uses loopback address aliases to solve this problem.

For example, add the alias IP 10.200.10.1 to the loopback address of the sink host, and then use this IP in the container to connect the service of the sink host.

Configure local loopback address alias under MAC