Mongo: Docker run throws error no space left error for /data/db

Created on 25 Nov 2016  路  5Comments  路  Source: docker-library/mongo

Getting Below error when run the docker

docker run -d -p 3000:27017 --name m1 --net mongo-net mongo mongod

2016-11-25T08:56:26.387+0000 I STORAGE [initandlisten] error creating journal dir /data/db/journal boost::filesystem::create_directory: No space left on device: "/data/db/journal"
2016-11-25T08:56:26.387+0000 I STORAGE [initandlisten] exception in initAndListen std::exception: boost::filesystem::create_directory: No space left on device: "/data/db/journal", terminating
2016-11-25T08:56:26.388+0000 I CONTROL [initandlisten] dbexit: rc: 100

Most helpful comment

I would guess that you are on a Mac using "Docker for Mac". I think that the VM provisioned by docker does not have enough space and so mounting you host's directory gave it the space that it needed.

All 5 comments

I didn't face the issue when mount a volume to /data/db
ocker run -d -p 3000:27017 -v /Users/user/work/m1:/data/db --name m1 --net mongo-net mongo mongod

Look like it has something to do with docker image

I would guess that you are on a Mac using "Docker for Mac". I think that the VM provisioned by docker does not have enough space and so mounting you host's directory gave it the space that it needed.

@yosifkit thats right. I could clean up some space by deleting unused docker instances and this error gone away

Also works if added: --smallfiles
In compose you can use:
command: mongod --smallfiles

What I've also seen on Docker for Mac is that the available disk space can be exhausted by too many local images. Removing unused images can help then.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tdaleibm picture tdaleibm  路  5Comments

jamesongithub picture jamesongithub  路  6Comments

jjelev picture jjelev  路  5Comments

dev-nicelee picture dev-nicelee  路  6Comments

vito-c picture vito-c  路  4Comments