This seemingly simple task turns out very difficult.
I am trying to get docker container's IP from .net project, in my case using c#.
What I have tried so far (This returns docker engine's IP (DockerNAT), not the container's IP):
Dns.GetHostEntry(name).AddressList.FirstOrDefault(x => x.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork);
If I use ipconfig, the list does not contain the container's IP address, which you can find using docker network inspect network_name (Below list doesn't contain container's IP):
var networkInterfaces = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();
Any other idea to access the container's IP in C#?