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:
paketo-buildpacks/ca-certificates
bindings?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.
I got it. Maven configuration above is for maven package
target, not spring-boot:build-image
.
Here is the complete procedure:
bindings/ca-certificates
folder at maven project root and add to it:
type
file containing just ca-certificates
build-image
execution to spring-boot-maven-plugin
with ${basedir}/bindings/ca-certificates:/platform/bindings/ca-certificates
image binding as configured in my questionmvn clean package