title: How to change permission of mapped volume in kubernetes/Docker
body: <p>I just created image using Docker file and for changing user I just used:</p>
  
  <pre><code>USER myuser
  </code></pre>
  
  <p>We are using a directory to store data, we change that directory permission using:</p>
  
  <pre><code>chown -R myuser:myuser /data-dir
  </code></pre>
  
  <p>This Docker file is for etcd, where we want /data-dir use by etcd to store data. Now, we map the /data-dir to efs volume using kubernetes yml file.</p>
  
  <p>With the below code:</p>
  
  <pre><code>volumeMounts:
          - name: etcdefs
            mountPath: /data-dir
        volumes:
        - name: etcdefs
          persistentVolumeClaim:
            claimName: efs-etcd
  </code></pre>
  
  <p>After this, I expect, that mapped directory /data-dir should have permission as myuser:myuser but it making the directory as root:root</p>
  
  <p>Can any one suggest what I am doing wrong here ?</p>