How to get the ip and port of the docker host in a docker container?

When a docker container is starting, its explosed port would be mapped to a port of the docker host.

Of cause, I can use the specified mapped port, but, I don’t want to do so.

  • Consul: SD architecture. What is the right way to access microservices from a front-end side?
  • Sending Multicast Packets from Docker Container (to multicast group)
  • Deploying spark-jobserver to BlueMix Spark Node
  • Docker Entrypoint script cannot get $DB_PORT_3306_TCP_ADDR environment variable
  • Docker container doesn't start, showing as 'Exited n seconds ago'
  • docker run with cd command fails with executable file not found in $PATH
  • Is there a method to get the ip and port of the docker host in a docker container when it is starting.

  • Can't get remote Hazelcast client to connect to cluster running in docker containers
  • Why does fig try to 'echo' in my nearly-empty container?
  • Different file owner inside Docker container and in host machine
  • One or multiple databases per Docker container
  • how to load dump on docker mysql container based on centos6?
  • Docker, independent multiple rails instances
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.