首页 > 解决方案 > 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 并尝试释放它,如下所述:

当我运行时:

heroku container:release web --app my-app

我收到以下错误:

▸    Expected response to be successful, got 404

通过谷歌搜索错误,似乎是由于生成的 Docker 映像使用 ENTRYPOINT而不是CMD启动应用程序,如下面的链接中所述:

是否可以配置 Spring Boot Buildpack 以CMD代替使用ENTRYPOINT?或者任何其他在 Heroku 上部署生成的 Docker 镜像的解决方案?

标签: spring-bootdockerheroku

解决方案


推荐阅读