<p>I've an app, packaged as docker image. The app has some default plugins, installed in <code>/opt/myapp/plugins/</code>. I want to install some additional plugins, which basically means copying the plugins to the app's aforementioned path:</p>

<pre class="lang-sh prettyprint-override"><code>cp /path/to/more-plugins/* /opt/myapp/plugins/
</code></pre>

<p>How do I do that? Is <code>initContainers</code> helpful in such cases? Does init-container have access to the filesystem of the app-container, so that the above command can be executed? I tried to use <code>busybox</code> in <code>initContainers</code> and ran <code>ls -lR /opt/myapp</code> just to see if such a path even exists. But it seems, init container doesn't have access to the app-filesystem. </p>

<p>So what are the different solutions to this problem? And what is the best one?</p>

Nawaz
<p>I'm not a container expert, but my understanding is that the best way to do this is to create a new container, based on your current docker image, that copies the files into place.  Your image, with your plugins and configs, is what k8s loads and manages.</p>

<pre><code>FROM my/oldimage:1.7.1
COPY more-plugins/* /opt/myapp/plugins/
</code></pre>

<pre><code>$ docker build -t my/newimage:1.7.1 .
</code></pre>
