title: How to persist my notebooks and data in my Docker image/container
body: <p>I am new to Docker and I am confused about containers and images somehow. I want to sue Docker for Tensorflow development. All I need is to have an easy way to write Jupyter Notebooks and use GPU powered Tensorflow.</p>
  
  <p>I have the latest Tensorflow Jupyter Python 3 Image already. I run the Image with</p>
  
  <pre><code>docker run --rm --runtime=nvidia -v -it -p 8888:8888 tensorflow/tensorflow:latest-gpu-py3-jupyter
  </code></pre>
  
  <p>How can I make it so that my data when I work in that Image and add and edit my Jupyter Notebooks won't get lost after I exit the process. I know that Docker Images aren't meant to persist state but I am so new to this I just want something to work in with persistent data. Can someone help me guide me through this or point to a resource which will answer all my prayers?</p>
  
  <p>I would also like to move some stuff into the Container that is going to be run so that I can access some custom Python libs because they contain some things that my Notebooks need to import!</p>
  
  <p>Side questions:</p>
  
  <p><code>--rm</code> removes the container or whatever by default I run it without this flag still my data was lost</p>
  
  <p><code>-v</code> is for volumes? I tried with <code>-v Bachelor:/app</code> to mount a volume like so. It apparently doesn't make any difference. I don't know how to use the volume Bachelor that I created. Instead there are a multitude of unnamed volumes being created that are not usable whenever I run this</p>
  
  <p><code>-it</code> does also something no idea what</p>
  
  <p><code>-p</code> is the port number right?</p>