Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'

后端 未结 1 583
渐次进展
渐次进展 2020-12-20 13:46

I am using asp.net core 3.1 docker enabled project template (VS2019) to develop a web API. There are no compilation errors.

While running the project, in the output

1条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-20 14:30

    To workaround the issue, add the code ENV ASPNETCORE_URLS=http://+:80 below the other ENV declarations at the top of the Dockerfile.develop file

    Dockerfile.develop after:

    FROM mcr.microsoft.com/dotnet/core/sdk:3.1
    ARG BUILD_CONFIGURATION=Debug
    ENV ASPNETCORE_ENVIRONMENT=Development
    ENV DOTNET_USE_POLLING_FILE_WATCHER=true  
    ENV ASPNETCORE_URLS=http://+:80  
    EXPOSE 80
    

    0 讨论(0)
提交回复
热议问题