title: How to deploy Asp.net core 2.2 application on heroku using docker image and avoid Dockerfile errors
body: <p>I'm building an asp.net core 2.2 application in docker image to host it in Heroku, but i don't know what's the exact dockerfile configuration should be, i used an example of Dockerfile but i get this error after opening the application on heroku: </p>
  
  <h2>Application error: An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command heroku logs --tail</h2>
  
  <p>This is the log file : </p>
  
  <p><code>
  2019-04-10T02:51:45.024996+00:00 heroku[web.1]: State changed from crashed to starting
  2019-04-10T02:51:52.077699+00:00 heroku[web.1]: Starting process with command <code>/bin/sh -c ASPNETCORE_URLS\=http://\*:\58395\ dotnet\ sitehidamek.dll</code>
  2019-04-10T02:51:53.841749+00:00 heroku[web.1]: State changed from starting to crashed
  2019-04-10T02:51:53.820061+00:00 heroku[web.1]: Process exited with status 145
  2019-04-10T02:51:53.715427+00:00 app[web.1]: Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
  2019-04-10T02:51:53.715458+00:00 app[web.1]: <a href="http://go.microsoft.com/fwlink/?LinkID=798306&amp;clcid=0x409" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkID=798306&amp;clcid=0x409</a>
  2019-04-10T03:34:20.255335+00:00 heroku[web.1]: State changed from crashed to starting
  2019-04-10T03:34:26.731799+00:00 heroku[web.1]: Starting process with command <code>/bin/sh -c ASPNETCORE_URLS\=http://\*:\41495\ dotnet\ sitehidamek.dll</code>
  2019-04-10T03:34:28.273366+00:00 heroku[web.1]: State changed from starting to crashed
  2019-04-10T03:34:28.245573+00:00 heroku[web.1]: Process exited with status 145
  2019-04-10T03:34:28.208525+00:00 app[web.1]: Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
  2019-04-10T03:34:28.208542+00:00 app[web.1]: <a href="http://go.microsoft.com/fwlink/?LinkID=798306&amp;clcid=0x409" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkID=798306&amp;clcid=0x409</a>
  2019-04-10T04:57:22.211933+00:00 heroku[web.1]: State changed from crashed to starting
  2019-04-10T04:57:28.788242+00:00 heroku[web.1]: Starting process with command <code>/bin/sh -c ASPNETCORE_URLS\=http://\*:\5818\ dotnet\ sitehidamek.dll</code>
  2019-04-10T04:57:30.339475+00:00 heroku[web.1]: State changed from starting to crashed
  2019-04-10T04:57:30.315137+00:00 heroku[web.1]: Process exited with status 145
  2019-04-10T04:57:30.260093+00:00 app[web.1]: Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
  2019-04-10T04:57:30.260116+00:00 app[web.1]: <a href="http://go.microsoft.com/fwlink/?LinkID=798306&amp;clcid=0x409" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkID=798306&amp;clcid=0x409</a>
  2019-04-10T07:38:35.071679+00:00 heroku[web.1]: State changed from crashed to starting
  2019-04-10T07:38:42.362172+00:00 heroku[web.1]: Starting process with command <code>/bin/sh -c ASPNETCORE_URLS\=http://\*:\30695\ dotnet\ sitehidamek.dll</code>
  2019-04-10T07:38:43.942597+00:00 heroku[web.1]: State changed from starting to crashed
  2019-04-10T07:38:43.928214+00:00 heroku[web.1]: Process exited with status 145
  2019-04-10T07:38:43.874881+00:00 app[web.1]: Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
  2019-04-10T07:38:43.874911+00:00 app[web.1]: <a href="http://go.microsoft.com/fwlink/?LinkID=798306&amp;clcid=0x409" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkID=798306&amp;clcid=0x409</a>
  2019-04-10T12:01:49.430309+00:00 app[api]: Deployed web (a1ffce692888) by user javator.developper@gmail.com
  2019-04-10T12:01:53.388766+00:00 heroku[web.1]: State changed from crashed to starting
  2019-04-10T12:01:49.430309+00:00 app[api]: Release v9 created by user javator.developper@gmail.com
  2019-04-10T12:01:59.449423+00:00 heroku[web.1]: Starting process with command <code>/bin/sh -c ASPNETCORE_URLS\=http://\*:\29461\ dotnet\ sitehidamek.dll</code>
  2019-04-10T12:02:02.125769+00:00 heroku[web.1]: State changed from starting to crashed
  2019-04-10T12:02:02.200130+00:00 heroku[web.1]: State changed from crashed to starting
  2019-04-10T12:02:02.100437+00:00 heroku[web.1]: Process exited with status 145
  2019-04-10T12:02:02.027670+00:00 app[web.1]: Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
  2019-04-10T12:02:02.027705+00:00 app[web.1]: <a href="https://go.microsoft.com/fwlink/?LinkID=798306&amp;clcid=0x409" rel="nofollow noreferrer">https://go.microsoft.com/fwlink/?LinkID=798306&amp;clcid=0x409</a>
  2019-04-10T12:02:06.637725+00:00 heroku[web.1]: Starting process with command <code>/bin/sh -c ASPNETCORE_URLS\=http://\*:\26871\ dotnet\ sitehidamek.dll</code>
  2019-04-10T12:02:08.966532+00:00 heroku[web.1]: State changed from starting to crashed
  2019-04-10T12:02:08.947251+00:00 heroku[web.1]: Process exited with status 145
  2019-04-10T12:02:08.904559+00:00 app[web.1]: Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
  2019-04-10T12:02:08.904574+00:00 app[web.1]: <a href="https://go.microsoft.com/fwlink/?LinkID=798306&amp;clcid=0x409" rel="nofollow noreferrer">https://go.microsoft.com/fwlink/?LinkID=798306&amp;clcid=0x409</a>
  </code></p>
  
  <p>Dockerfile content is:</p>
  
  <p><strong>FROM microsoft/aspnetcore:2.0</strong></p>
  
  <p><strong>WORKDIR /app</strong></p>
  
  <p><strong>COPY . .</strong></p>
  
  <p><strong>CMD ASPNETCORE_URLS=http://*:$PORT dotnet sitehidamek.dll</strong></p>
  
  <p>Any suggestions please ? </p>
  
  <p>I'm working on Visual Studio code (Mac os).</p>