Hence imported the self-signed certificate of HTTPS external URL into Docker container's JRE cacert keystore.
No: you need to import it into the Docker image from which you run your container.
Importing it into the container would only create a temporary writable data layer, which will be discarded when you restart your container.
Something like this answer:
USER root
COPY ldap.cer $JAVA_HOME/jre/lib/security
RUN
cd $JAVA_HOME/jre/lib/security
&& keytool -keystore cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias ldapcert -file ldap.cer
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…