title: How does Docker AUFS persist data?
body: <p>I have some doubts about how docker AUFS persists data. As i understand, data inside <strong>VOLUME</strong> can be persistent and others location can not. Here made an example, pull a mysql container whose <a href="https://github.com/mysql/mysql-docker/blob/mysql-server/5.7/Dockerfile" rel="nofollow noreferrer">dockerfile</a> there and do below steps:</p>
  
  <ol>
  <li>make a <code>test</code> directory under <code>/opt</code> directory which shouldn't be persistent in docker container</li>
  <li>login mysql and create a database, so <code>/var/lib/mysql</code> directory added one additional file</li>
  <li>stop such container and start again</li>
  <li>commit such container and then remove the container</li>
  <li>start the committed container and check whether database still exitst</li>
  </ol>
  
  <p><strong>Result</strong></p>
  
  <ul>
  <li>After step 3, all exists inside container including <code>test</code> directory
  which i think shouldn't be persist in <code>AUFS</code>. So whether all i know about docker aufs is wrong? </li>
  <li>After step 5 i can see database not exists in new container, but why? shouldn't file inside <code>/var/lib/mysql</code> be persist? </li>
  </ul>
  
  <p><strong>Here is my running docker command</strong></p>
  
  <pre><code>docker build -td --name mysql_test mysqlImageId
  </code></pre>
  
  <p><strong><em>Attention</em></strong>: i have not specified <code>-v</code> options</p>