title: ASP .NET Core gives System.Net.Sockets.SocketException error on Heroku
body: <p>I am trying to deploy .NET core web API to Heroku.</p>
  
  <p>Below is my <code>Dockerfile</code>:</p>
  
  <pre><code>FROM mcr.microsoft.com/dotnet/core/aspnet:2.1 AS runtime
  WORKDIR /app
  COPY /out ./
  CMD ASPNETCORE_URLS=http://*:$PORT dotnet dotnetcoreapi.dll
  </code></pre>
  
  <p>This <code>Dockerfile</code> works fine on Heroku, but when I tried to deploy with</p>
  
  <pre><code>FROM mcr.microsoft.com/dotnet/core/aspnet:2.1 AS runtime
  WORKDIR /app
  COPY /out ./
  ENTRYPOINT ["dotnet","dotnetcoreapi.dll"]
  </code></pre>
  
  <p>Heroku gives me this error:</p>
  
  <blockquote>
    <p>Unable to start Kestrel. System.Net.Sockets.SocketException (13): Permission denied</p>
  </blockquote>
  
  <p>Why doesn't <code>ENTRYPOINT ["dotnet","dotnetcoreapi.dll"]</code> work on Heroku? Both versions work fine on my local machine</p>