title: Using docker image to store data files
body: <p>I am new to docker and have just started exploring it. What I am trying to achieve is to publish a Docker image, which would just have some configuration files. These files would be shared across multiple projects.</p>
  
  <p><strong>So the image I want to publish is 'my-config-image'.</strong></p>
  
  <hr>
  
  <p><strong>This is how the directory structure is:</strong></p>
  
  <pre><code>/my-config-settings
       /folder1/multiple files
       /folder2/multiple files
       file1.txt
       file2.txt
  </code></pre>
  
  <hr>
  
  <p>After reading online and going through the docker quick start I have got some understanding.</p>
  
  <p>I decided to use Create a simple base image using <code>scratch</code>.
  referred from (<a href="https://docs.docker.com/engine/userguide/eng-image/baseimages/" rel="noreferrer">https://docs.docker.com/engine/userguide/eng-image/baseimages/</a>)</p>
  
  <p><strong>This is how my Dockerfile looks.</strong></p>
  
  <pre><code>FROM scratch
  ADD folder1 / folder2 /
  </code></pre>
  
  <p>This is the command I am using to publish an image.</p>
  
  <pre><code>/my-config-settings/docker build -t my-config-image .
  Sending build context to Docker daemon  5.12 kB
  Step 1 : FROM scratch
   ---&gt; 
  Step 2 : ADD folder1 / folder2 /
   ---&gt; Using cache
   ---&gt; cc9c3f338f51
  Successfully built cc9c3f338f51
  </code></pre>
  
  <p>When I want to check if the image was created locally I am confirming it in this way by executing</p>
  
  <pre><code>docker images
  
  
  REPOSITORY                                          TAG                 IMAGE ID            CREATED             SIZE
  my-config-image                                     latest              cc9c3f338f51        2 minutes ago       39 B
  </code></pre>
  
  <p>My main query is how can I check if this is working, Also did this add the file1.txt and file2.txt into the image, if not how do I specify to add these files in the image.</p>
  
  <p>Is there a way I can add all the files and directories recursively into the image I am trying to create?</p>
  
  <p>Also how to I access this image, means how can I check if this image actually has all the folders and files. Is there a way to cd into this?</p>
  
  <p>I am okay with suggestions and looking at another docker approach, if what I am trying to do doesn't make sense.</p>
  
  <p>Thank you for reading.</p>