<p>I have a very simple java jar application that fetches DB properties from the env variables.
I`ve dockerized it and migrated to Kubernetes. I also created a config map and secret with parameters to my DB - so I have access to these properties in the container. 
Is it possible to fetch all properties and inject it in Dockerfile? How can I do it?</p>

<pre><code>FROM openjdk:8-jre
ADD target/shopfront-0.0.1-SNAPSHOT.jar app.jar
EXPOSE 8010
ENTRYPOINT ["java","-Ddb.host=**value-from-env-variable**","-jar","/app.jar"]
</code></pre>

michf
<p>The array or <a href="https://docs.docker.com/engine/reference/builder/#exec-form-entrypoint-example" rel="nofollow noreferrer">"exec form"</a> of entrypoint uses <code>exec</code> to run the specified binary rather than a shell. Without a shell the string <code>$DB_HOST</code> is passed to your program as argument. </p>

<h3>Shell form</h3>

<pre><code>ENTRYPOINT java -Ddb.host="${DB_HOST}" -jar /app.jar
</code></pre>

<h3>Shell script</h3>

<p>If your startup get more complex you can also use an <code>ENTRYPOINT</code> script. </p>

<pre><code>ENTRYPOINT ["/launch.sh"]
</code></pre>

<p>Then <code>launch.sh</code> contains:</p>

<pre><code>#!/bin/sh -uex
java -Ddb.host="${DB_HOST}" -jar /app.jar
</code></pre>
