spring-boot - Heroku 上的 Spring Boot Cloud Native Buildpacks?
问题描述
我将我的 Spring Boot 项目配置为使用云原生 Buildpacks 来构建其 docker 映像,如下所示:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<name>my-image</name>
</image>
</configuration>
</plugin>
</plugins>
</build>
生成的 Docker 映像工作正常,但我想将它部署在 Heroku 上。我将它推送到 Heroku Container Registry 并尝试释放它,如下所述:
- https://devcenter.heroku.com/articles/container-registry-and-runtime#building-and-pushing-image-s
- https://devcenter.heroku.com/articles/container-registry-and-runtime#releasing-an-image
当我运行时:
heroku container:release web --app my-app
我收到以下错误:
▸ Expected response to be successful, got 404
通过谷歌搜索错误,似乎是由于生成的 Docker 映像使用
ENTRYPOINT
而不是CMD
启动应用程序,如下面的链接中所述:
- https://github.com/grandnode/grandnode/issues/563
- https://github.com/heroku/cli/issues/1081
- https://devcenter.heroku.com/articles/container-registry-and-runtime#dockerfile-commands-and-runtime
是否可以配置 Spring Boot Buildpack 以CMD
代替使用ENTRYPOINT
?或者任何其他在 Heroku 上部署生成的 Docker 镜像的解决方案?
解决方案
推荐阅读
- ruby - 包含模块在 gem 中不起作用
- python - 在一个语句中连接多个数据框并仅选择所需的列
- php - 我无法通过 PHP-Curl 发布并重定向到支付网关
- python - 使用 Pandas 将一个字符串列组合到另一列
- amazon-web-services - AWS Connect 无法调用 lambda / 将记录保存到 s3 存储桶
- c++ - 初始化期间程序未与 Array 一起运行
- wordpress - 在子目录中安装 Wordpress,出现 403 错误
- javascript - 字段末尾的 Firebase 字符串匹配
- node.js - 将 Socket.io 分离到 app.js
- reactjs - Material UI:Card 组件内的中心 CardContent