Finally it’s working!
My solution:
Place the missing cert and a batch script in the config directory which is mounted inside the container.
The scrip is:
installCert
#!/bin/bash
$JAVA_HOME/bin/keytool -importcert -file /openhab/conf/services/<missingCertName>.crt -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -alias <certName>
and finally call it on the container creation:
docker run \
--name openhab \
--restart unless-stopped \
--detach \
...
openhab/openhab
docker exec openhab /openhab/conf/services/installCert