I need to add self-signed certificates to a spring-boot docker image using spring-boot:build-image
and paketo-buildpacks/ca-certificates
but couldn't get it working.
So:
- where to put the certificates to add?
- in which format?
- how to define
paketo-buildpacks/ca-certificates
bindings? - should any additional argument be provided to
mvn spring-boot:build-image
?
What I tried with no success so far:
update pom.xml spring-boot-maven-plugin
:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<bindings>
<binding>${basedir}/bindings/ca-certificates:/platform/bindings/ca-certificates</binding>
</bindings>
</image>
</configuration>
<executions>
<execution>
<goals>
<goal>build-image</goal>
</goals>
</execution>
</executions>
</plugin>
from ${basedir}
folder:
mkdir bindings
mkdir bindings/ca-certificates
echo "ca-certificates" > bindings/ca-certificates/type
cp ~/.ssh/mycert.pem bindings/ca-certificates/
mvn spring-boot:build-image
Edit: moved image bindings configuration directly under boot-plugin (rather than inside a specific execution) as suggested by @nick-valanos and solved the problem.