title: Docker run returning exit code 100 or 51
body: <p>When I try to run my mongoDB image called database with <code>sudo docker run -p 27017:27017</code> I get exitCode 100. I looked at some info online and found this about exitCode 100: <code>Returned by mongod when the process throws an uncaught exception</code>. I've had this issue before and was able to fix it with <code>docker system prune --force</code> but when i do it now I get the same exitCode.</p>
  <p>I have tried building the image again but when I do that I either get the same exitCode or exitCode 51, of which I can't find any info online.</p>
  <p>Any idea how I can fix this?</p>
  <p>EDIT: I am working on an Ubuntu server vm and it has worked before.</p>
  <p>Content of my Dockerfile:</p>
  <pre><code>From mongo:latest
  
  COPY usertoevoegen.js /docker-entrypoint-initdb.d/
  
  RUN mongod --fork  --logpath /var/log/mongodb.log --dbpath /data/db
  </code></pre>
  <p>Content of usertoevoegen.js:</p>
  <pre class="lang-js prettyprint-override"><code>db=db.getSiblingDB('admin');
  
  db.createUser({user: &quot;admin&quot;,pwd: &quot;admin123&quot;,roles: [{ role: &quot;root&quot;, db: &quot;admin&quot; }]});
  
  db.createCollection(&quot;gebruiker&quot;);
  
  db.gebruiker.insert([{&quot;naam&quot; : &quot;Toon&quot;}]);
  </code></pre>