Reputation: 61
I am deploying a .Net Core application using Docker Containers.
I was able to push the image successfully using heroku container:push web
But calling heroku container:release web
returns No command specified for process type web
.
I'm a bit stumped I've tried adding heroku.yml
setup:
addons:
- plan: heroku-postgresql
as: DATABASE
build:
docker:
web: Dockerfile
config:
ASPNETCORE_ENVIRONMENT: development
run:
web: dotnet Api.dll
On the root directory but still no luck.
I can confirm that the image was created I'm seeing this in docker
REPOSITORY TAG IMAGE ID CREATED SIZE
registry.heroku.com/immense-temple-11020/web latest 5cb62a9af317 16 minutes ago 272MB
If anyone could point me to the right direction, it would be much appreciated. Thanks!
Upvotes: 6
Views: 1211
Reputation: 2105
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."
Upvotes: 2
Reputation: 61
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!
Upvotes: 0