首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将packeto-buildpack/google-stackdriver添加到spring启动级构建中。

将packeto-buildpack/google-stackdriver添加到spring启动级构建中。
EN

Stack Overflow用户
提问于 2022-02-09 08:12:30
回答 1查看 244关注 0票数 0

我想在我们的一个项目中使用谷歌云分析器。因为我们使用buildpack来创建我们的docker映像,所以我们不能使用使用dockerfile来添加buildpack的标准方法。

,所以我想知道:如何将构建包添加到我的gradle构建中?

我创建了一个标准的spring引导应用程序,并将buildpack添加到任务中

代码语言:javascript
复制
...
bootBuildImage {
    verboseLogging = true
    buildpacks = [
        "paketo-buildpacks/google-stackdriver"
    ]
}

但是如果我运行构建我就能得到

代码语言:javascript
复制
 > Task :bootBuildImage Building image 'docker.io/library/cnb-add-buildpack:0.0.1-SNAPSHOT'
 
 > Pulling builder image 'docker.io/paketobuildpacks/builder:base' ..................................................
 > Pulled builder image 'paketobuildpacks/builder@sha256:ac9f318cade49b78c229a8bf7858435514b5573177de2a29d2b30bafd5f0b7ec'
 > Pulling run image 'docker.io/paketobuildpacks/run:base-cnb' ..................................................
 > Pulled run image 'paketobuildpacks/run@sha256:41ea15b4d591c2722543009fbf8267a13019ecdc8c6a2b4f437ed83ed29bf72c'
 > Executing lifecycle version v0.13.3
 > Using build cache volume 'pack-cache-fa9655d690f5.build'

 > Running creator
    [creator]     ===> DETECTING
    [creator]     ======== Results ========
    [creator]     fail: paketo-buildpacks/google-stackdriver@5.3.1
    [creator]     ERROR: No buildpack groups passed detection.
    [creator]     ERROR: Please check that you are running against the correct path.
    [creator]     ERROR: failed to detect: no buildpacks participating

> Task :bootBuildImage FAILED

FAILURE: Build failed with an exception.

 * What went wrong: Execution failed for task ':bootBuildImage'.
 > Builder lifecycle 'creator' failed with status code 100
 
 * Try:
 > Run with --stacktrace option to get the stack trace.
 > Run with --info or --debug option to get more log output.
 > Run with --scan to get full insights.
 
 * Get more help at https://help.gradle.org
 
 BUILD FAILED in 44s

编辑1:

在添加了一个文件夹/platform/bindings/google-stackdriver,包括一个名为type的文件和内容StackdriverProfiler之后,我仍然可以得到相同的结果。

编辑2:

将该buildpacks从build.gradle中移除并添加我的项目bindings而改为->之后,它起了作用。

因此,您只需要在项目文件夹type中创建一个名为StackdriverProfiler的文件,并在build.gradle中引用该绑定。

代码语言:javascript
复制
bootBuildImage {
    verboseLogging = true
    bindings = [ "${project.projectDir}/platform/bindings/google-stackdriver:/platform/bindings/google-stackdriver" ]
}
EN

回答 1

Stack Overflow用户

发布于 2022-02-09 14:38:26

看来paketo-buildpacks/google-stackdriver的先决条件还没有得到满足。你在这里读到了他们的故事:https://github.com/paketo-buildpacks/google-stackdriver#behavior

一般而言,它要求:

StackdriverDebugger

  • A绑定类型与StackdriverProfiler

类型存在绑定

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71045973

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档