Cannot assign requested address on dockerized services

Guys, i need help.

I am getting SocketException: Cannot assign requested address. It happens when i try to access serviceA by serviceB via Refit. If run one of the services on IIS or in Visual studio debugger everything works fine. But when i run them both in docker containers, system throw that error.

it also happens when use Ocelot. If the gateway service is on IIS or run in debugger (separate from other services) it works, but when I put it in container with the other services i get the error.

What could it be?

WIN 10
VS 2019/VS Code
Docker desktop
WEB API CORE 3
Refit - https://github.com/reactiveui/refit
Ocelot - https://github.com/ThreeMammals/Ocelot

Thank you

1 Like