title: Keep data in the external folder for mongodb docker container
body: <p>I am using <a href="https://registry.hub.docker.com/u/library/mongo/" rel="nofollow">official docker container</a>. Here is a <a href="https://github.com/docker-library/mongo/blob/master/2.6/Dockerfile" rel="nofollow">Dockerfile</a>.
  I am running container using this command:</p>
  
  <pre><code>docker run --name mongo-db -d -p 27017:27017 -v  /mnt/lacie/databases/mongo/data:/data mongo
  </code></pre>
  
  <p>Next I connect to mongodb, create a db, a collection and insert data on it.</p>
  
  <p>I can stop the container <code>docker stop</code>, run it again <code>docker start</code> and all the data changes will be present in the database.</p>
  
  <p>If I remove container <code>docker rm</code> and create new one - the data dissapear. Why? And how can I fix it?</p>