.NET Core Deployment to Heroku

I am trying to deploy .NET core web API to heroku.
Below is my docker file

FROM mcr.microsoft.com/dotnet/core/aspnet:2.1 AS runtime
WORKDIR /app
COPY /out ./
CMD ASPNETCORE_URLS=http://*:$PORT dotnet dotnetcoreapi.dll

Above docker file works fine in heroku, but when I tried to deploy with

FROM mcr.microsoft.com/dotnet/core/aspnet:2.1 AS runtime
WORKDIR /app
COPY /out ./
ENTRYPOINT ["dotnet","dotnetcoreapi.dll"]

Heroku throws me Unable to start Kestrel. System.Net.Sockets.SocketException (13): Permission denied error.
I would like to know what is wrong with ENTRYPOINT ["dotnet","dotnetcoreapi.dll"]. Because both works fine in my local machine.

Source: StackOverflow