title: Dynamically set JAVA_HOME of docker container
body: <p>My docker container requires JAVA_HOME to be set. I have added it to the Dockerfile as below </p>
  
  <pre><code>ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/jre
  </code></pre>
  
  <p>However, this is a hardcoding of the value. Is there a way I can get this value dynamically from the image itself</p>