title: Docker container write permissions
body: <p>I have some docker containers running on my machine, one of them being <code>container_1</code></p>
  
  <p>I am able to access <code>container_1</code>'s cli using </p>
  
  <pre><code>ant@ant~/D/m/l/db&gt; docker exec -it container_1 bash
  daemon@1997cc093b24:/$
  </code></pre>
  
  <p>This allows me to go to <code>container_1</code>'s cli but with no write permissions. The following commands give a permission denied error</p>
  
  <pre><code>ant@ant~/D/m/l/db&gt; docker exec -it container_1 touch test.txt
  bash: test.txt: Permission denied
  ant@ant~/D/m/l/db&gt;docker exec -it container_1 bash
  daemon@1997cc093b24:/$ touch test.txt
  bash: test.txt: Permission denied
  </code></pre>
  
  <p>Also tried using <code>--previleged</code> option but the problem persisted</p>
  
  <pre><code>ant@ant~/D/m/l/db&gt; docker --previleged=true exec -it container_1 touch test.txt
  bash: test.txt: Permission denied
  </code></pre>
  
  <p>So I have 2 questions</p>
  
  <ol>
  <li>How do permissions in docker work?</li>
  <li>Is this kind of modification to a docker filesystem recommended? If not why? </li>
  </ol>
  
  <p>I have recently started using docker. Please tolorate the amature question. Thanks in advance :) </p>