按照此处的建议,这些建议是如何使用 Spring Boot 的 maven 插件将 SSL 证书传递到构建映像中。
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<bindings>
<binding>${basedir}/bindings/certificates:/platform/bindings/ca-certificates</binding>
</bindings>
</image>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
project
|-bindings
|-certificates
|-type
|-certificate.crt
Run Code Online (Sandbox Code Playgroud)
$ cat bindings/certificates/type
ca-certificates
Run Code Online (Sandbox Code Playgroud)
$ ./mvnw spring-boot:build-image
...
...
...
[INFO] > Running creator
[INFO] [creator] ===> ANALYZING
[INFO] [creator] Restoring data for SBOM from previous image
[INFO] [creator] ===> DETECTING
[INFO] [creator] ======== Output: paketo-buildpacks/git@1.0.1 ========
[INFO] [creator] failed to load bindings from '/platform/bindings': failed to read binding …Run Code Online (Sandbox Code Playgroud)