Docker: dotnet core - Cannot assign requested address'
Date: 2020-11-26 | docker | dotnet-core | port |
DISCLOSURE: If you buy through affiliate links, I may earn a small commission. (disclosures)
Overview
I'm running a dotnet core dockerized app and trying to change its default port to http://localhost:8080
via the appsettings.json
Urls
field. However, I keep getting this error when running the container:
Unable to bind to http://localhost:8080 on the IPv6 loopback interface: 'Cannot assign requested address'.
How can I fix this?
Solution
The solution seems to be to change localhost
to host.docker.internal
. I don't really know why this is but that worked for me.
Want more like this?
The best way to support my work is to like / comment / share for the algorithm and subscribe for future updates.