title: Docker: Insert certificate into ketstore
body: <p>I'm trying to add a certificate into <code>$JAVA_HOME/jre/lib/security/cacerts</code> truststore on my <code>Dockerfile</code>:</p>
  
  <pre><code>FROM frolvlad/alpine-oraclejdk8:slim
  VOLUME /tmp
  RUN keytool -import -alias vault -storepass changeit -keystore $JAVA_HOME/jre/lib/security/cacerts -noprompt -trustcacerts -file /var/run/secrets/kubernetes.io/certs/tls.crt
  ADD wseccloudconfig-0.0.1-SNAPSHOT.jar app.jar
  RUN sh -c 'touch /app.jar'
  ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]
  </code></pre>
  
  <p>As you can see I'm performing a command <code>keytool...</code> in order to insert the certificate to <code>cacerts</code>.</p>
  
  <p>I'm deploying this image into my openshift/kubernetes cluster. Once I've connected to pod shell, I'm able to run this <code>keytool...</code> command rightly. So I mean, the command is well formed. There're no syntax problem or related issues...</p>
  
  <p>So, I was excepting that the output of this command: <code>keytool -list -keystore $JAVA_HOME/jre/lib/security/cacerts</code> appears my certificate, but it doesn't appear.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Also I've tried writing this in <code>Dockerfile</code>:</p>
  
  <pre><code>CMD ["keytool", "-import", "-alias", "vault", "-storepass", "changeit", "-keystore", "$JAVA_HOME/jre/lib/security/cacerts", "-noprompt", "-trustcacerts", "-file", "/var/run/secrets/kubernetes.io/certs/tls.crt"]
  </code></pre>