Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker run returning exit code 100 or 51

When I try to run my mongoDB image called database with sudo docker run -p 27017:27017 I get exitCode 100. I looked at some info online and found this about exitCode 100: Returned by mongod when the process throws an uncaught exception. I've had this issue before and was able to fix it with docker system prune --force but when i do it now I get the same exitCode.

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.

Any idea how I can fix this?

EDIT: I am working on an Ubuntu server vm and it has worked before.

Content of my Dockerfile:

From mongo:latest

COPY usertoevoegen.js /docker-entrypoint-initdb.d/

RUN mongod --fork  --logpath /var/log/mongodb.log --dbpath /data/db

Content of usertoevoegen.js:

db=db.getSiblingDB('admin');

db.createUser({user: "admin",pwd: "admin123",roles: [{ role: "root", db: "admin" }]});

db.createCollection("gebruiker");

db.gebruiker.insert([{"naam" : "Toon"}]);
like image 485
Toon Staes Avatar asked Mar 21 '26 13:03

Toon Staes


1 Answers

Apparently I didn't have enough storage left on my server which caused the error.

like image 158
Toon Staes Avatar answered Mar 23 '26 06:03

Toon Staes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!