Heroku CLI “No command specified for process type web” when releasing container

前端 未结 2 1411
滥情空心
滥情空心 2021-01-12 21:17

I am deploying a .Net Core application using Docker Containers.

I was able to push the image successfully using heroku container:push web

But ca

相关标签:
2条回答
  • 2021-01-12 21:47

    I figured out the reason after searching for hours.

    Apparently if forgot to call heroku stack:set container.

    Now I'm able to deploy and release!

    0 讨论(0)
  • 2021-01-12 21:54

    Did you have a CMD directive specified at the end of your Dockerfile? If not, that was likely causing the problem, which you then worked around by using heroku.yml and heroku stack:set container.

    Heroku is unclear on this in their documentation. I was able to get my container to run locally without a CMD directive, likely as you were. But if you read Heroku docs here or here you'll pick up that Heroku takes for granted that the Dockerfile will specify a CMD to run.

    I had the same problem until I added the CMD directive at the end of my Dockerfile. I'm still working though what exactly I should put as my CMD directive but I no longer get the No command specified for process type web error.

    Since you switched to using heroku.yml you were able to get around the CMD by using

    run:
      web: dotnet Api.dll
    

    Heroku docs say "If you don’t include a run section, Heroku uses the CMD specified in the Dockerfile."

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