<p>I have a simple image (mdw:1.0.0) with some content in it:</p>

<pre><code>FROM alpine:3.9
COPY /role /mdw
WORKDIR /mdw
</code></pre>

<p>I was expecting that my container 'nginx' would see the content of /mdw folder, but there is no file.</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
 name: init-demo
spec:
 initContainers:
 - name: install
   image: mdw:1.0.0
   imagePullPolicy: Never
   volumeMounts:
   - name: workdir
     mountPath: "/mdw"
 containers:
 - name: nginx
   image: nginx
   volumeMounts:
   - name: workdir
     mountPath: /mdw
   command: ["ls", "-l", "/mdw"]
 volumes:
 - name: workdir
   emptyDir: {}
</code></pre>

<p>Do you know what is the reason and how to fix it ?</p>

<p>Thank you very much</p>

Florent Valdelievre
<p>When mounting volume if directory already exists will get wiped. It's intentional and no fix really.</p>

<p>Only way would be to populate the directory after mounting is done.</p>
