A service to return the IP address of the sender
3.8K
We often struggle with attempting to determine the correct publishable IP address for a service. This occurs when operating in isolated network modes. It is also difficult to guess which network adaptor IP Address to use. The solution is to attempt to ping a service that resides within the cluster, on a different machine.
$ docker run -d -p 8080:80 philwinder/whatismyip
$ curl $HOST:8080
{"Ip":"192.168.99.1","Port":"57630","ForwardedIp":""}
The Ip field returns the Ip address from the request. If behind a proxy, the ForwardedIp field will be present.
Content type
Image
Digest
Size
56.6 MB
Last updated
over 10 years ago
docker pull philwinder/whatismyip