<p>In Docker Compose, when I mount an empty host volume to a location that already has data in the container, than this data is copied to the empty host volume on the first run.</p>

<p>E.g. if I use the nginx image and mount my empty host volume <code>nginx-config</code> to <code>/etc/nginx</code> in the nginx container then on the first start of the container everything from <code>/etc/nginx</code> is copied to my host volume <code>nginx-config</code>.</p>

<p>Meanwhile I am using Kubernetes and wondering how that's done in kubernetes? When I mount a empty PersistentVolume to an container at <code>/etc/nginx</code>, nothing is automatically copied to it ):</p>

stefan.at.kotlin
<p>You need to use an initContainer, mount the volume on a different path and do the copy explicitly.</p>
