title: Mongorestore in a Dockerfile
body: <p>I want to create a Docker image that starts a mongo server and automatically restores from a previous <code>mongodump</code> on startup.</p>
  
  <hr>
  
  <p>Here is my Dockerfile for the image:</p>
  
  <pre><code> FROM mongo
  
   COPY dump /home/dump
  
   CMD mongorestore /home/dump
  </code></pre>
  
  <p>When I run this, I run into this error:</p>
  
  <blockquote>
    <p><code>Failed: error connecting to db server: no reachable servers</code></p>
  </blockquote>
  
  <hr>
  
  <p><strong>Is there any way to get the <code>mongorestore</code> command to run through Docker?</strong></p>