我正在使用 Docker 容器部署 .Net Core 应用程序。
我能够使用成功推送图像heroku container:push web
但打电话heroku container:release web
回报No command specified for process type web
.
我有点困惑我尝试添加heroku.yml
setup:
addons:
- plan: heroku-postgresql
as: DATABASE
build:
docker:
web: Dockerfile
config:
ASPNETCORE_ENVIRONMENT: development
run:
web: dotnet Api.dll
在根目录上但仍然没有运气。
我可以确认图像已创建,我在 docker 中看到了这一点
REPOSITORY TAG IMAGE ID CREATED SIZE
registry.heroku.com/immense-temple-11020/web latest 5cb62a9af317 16 minutes ago 272MB
如果有人能指出我正确的方向,我将不胜感激。谢谢!
你有没有CMD
在 Dockerfile 末尾指定的指令?如果没有,这可能是导致问题的原因,然后您可以使用以下方法解决该问题heroku.yml
and heroku stack:set container
.
Heroku 在他们的文档中对此并不清楚。我能够让我的容器在本地运行,而无需CMD
指令,可能就像你一样。但如果你阅读 Heroku 文档here or here你会发现 Heroku 理所当然地认为 Dockerfile 将指定一个CMD
to run.
我遇到了同样的问题,直到我添加了CMD
指令位于我的 Dockerfile 末尾。我仍在努力,尽管我到底应该把什么作为我的CMD
指令,但我不再明白No command specified for process type web
error.
自从您改用heroku.yml
你能够绕过CMD
通过使用
run:
web: dotnet Api.dll
Heroku 文档say“如果您不包括run
部分,Heroku 使用CMD
在 Dockerfile 中指定。”
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)