<p>I have an application war which reads an API implementation jar file to load some data in memory. What I am doing currently is that I COPY that jar inside my &quot;application-war/lib&quot; directory using docker file while generating my applications images.</p>
<p>The downside of this is that whenever the jar needs to be changed; I need to recreate my application war docker image.</p>
<p>Is there a way that I can externalize this jar file location, that I just need to restart of my running pod rather creating a new image each time.</p>
<p>I mean someway if I can give an additional CLASSPATH which my pods container can read while starting up.</p>
<p>Thanks</p>

Jaraws
<p>To provide a bit more context.
Everything what was said by <a href="https://stackoverflow.com/users/3772478/hazim">@Hazim</a> is correct and I fully agree with him about you doing the current build the correct way as it's allows you to see image history and quickly switch if needed.</p>
<p>As for using external files inside your image.
You need to setup a <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">PV  - persistent volume</a>, which will be utilized by <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims" rel="nofollow noreferrer">PVC - persistent volume claim</a>.
A really detailed description with exampled is available on <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/" rel="nofollow noreferrer">Configure a Pod to Use a PersistentVolume for Storage</a>.
It shows how to create a folder on your node place a file in it which later will be loaded into a <code>pod</code>. You won't be loading that file into a <code>pod</code> but using the path in your <code>Dockerfile</code> to load the <code>.jar</code> file.</p>
<p>If your <code>.jar</code> file is composed of <code>key=value</code> entries you could also use <a href="https://kubernetes.io/docs/concepts/configuration/configmap/" rel="nofollow noreferrer">ConfigMap</a> instead of PV. This is nicely explained on a Redis application which you can see here <a href="https://www.bogotobogo.com/DevOps/Docker/Docker_Kubernetes_Configure_a_Pod_to_Use_a_ConfigMap.php" rel="nofollow noreferrer">DOCKER / KUBERNETES - CONFIGURE A POD TO USE A CONFIGMAP</a>.</p>
<p>I hope this provides all needed information.</p>
