![](/img/trans.png)
[英]How to configure buildpack bindings with the spring-boot-maven-plugin?
[英]Paketo buildpack spring-boot-maven-plugin doesn't find sbom
我正在使用spring-boot-maven-plugin来生成 buildpack(内部使用 Paketo buildpack)。
在构建阶段,此跟踪会显示多次:
[creator] Warning: BOM table is deprecated in this buildpack api version, though it remains supported for backwards compatibility. Buildpack authors should write BOM information to <layer>.sbom.<ext>, launch.sbom.<ext>, or build.sbom.<ext>.
当我使用 --bom 选项进行检查时,我收到以下警告:
pack inspect-image docker.io/library/my-springboot-test:1.0.0.Final --bom
Warning: Using the '--bom' flag with 'pack inspect-image <image-name>' is deprecated. Users are encouraged to use 'pack sbom download <image-name>'.
{
"remote": null,
"local": [
{...
当我按照建议尝试“打包 sbom 下载 docker.io/library/my-springboot-test:1.0.0.Final”时:
ERROR: could not find SBoM information on 'docker.io/library/my-springboot-test:1.0.0.Final'
有人知道如何将 sbom 信息包含到 buildpack 中吗?
我也尝试在同一个 pom 中使用 CycloneDX 插件,这个插件会生成 sbom,但我不知道把它放在哪里被 Paketo 考虑构建图像。
<plugin>
<groupId>org.cyclonedx</groupId>
<artifactId>cyclonedx-maven-plugin</artifactId>
<version>2.7.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>makeAggregateBom</goal>
</goals>
</execution>
</executions>
<configuration>
<projectType>library</projectType>
<schemaVersion>1.4</schemaVersion>
<includeBomSerialNumber>true</includeBomSerialNumber>
<includeCompileScope>true</includeCompileScope>
<includeProvidedScope>true</includeProvidedScope>
<includeRuntimeScope>true</includeRuntimeScope>
<includeSystemScope>true</includeSystemScope>
<includeTestScope>false</includeTestScope>
<includeLicenseText>false</includeLicenseText>
<outputReactorProjects>true</outputReactorProjects>
<outputFormat>json</outputFormat>
<outputName>../layers/build.sbom.cdx</outputName>
</configuration>
</plugin>
有可能做到吗? 什么失败了?
这是 Spring 引导 Maven 和 Gradle 插件在 Z38008DD81C2F4D7985ECF26618 引导中的限制。
此版本的 Spring Boot 实现了旧版本的 buildpacks 平台规范,该规范早于新的 SBOM 规范。 不过,buildpacks 和 buildpacks 工具已经开始使用这个新的 SBOM 规范。
有两种可能的解决方案:
升级到 Spring 2.7。 这实现了最新的平台规范,并将支持新的 SBOM 格式。
如果你还不能升级到 2.7,你可以使用 pack cli 或 kpack 来运行你的构建,直到你可以升级。 它们还支持使用新 SBOM 格式所需的更新平台 API。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.