How to query a container host's IP address from inside a container
Issue
- What is the method to get a host's IP address inside the container so that the app running in the container can transmit data to an agent running on the host? Is there a better way to get the host IP address other than running the following command inside the container?
# netstat -nr | grep '^0\.0\.0\.0' | awk '{print $2}'
Environment
- OpenShift Enterprise 3.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.