I am having the problem mentioned in dockerfile/mongodb#9 and again in docker-library/official-images#281. As suggested in the latter, I opened the issue here.
I am using Mac OS X 10.10.3 with:
> boot2docker version
Boot2Docker-cli version: v1.7.1
> docker version
Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): darwin/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64
> docker info | grep Storage
Storage Driver: aufs
> docker-compose logs mongo
mongo_1 | mongod --help for help and startup options
mongo_1 | Sat Aug 15 16:19:02.094 [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db/ 64-bit host=dcdc00ea89ac
mongo_1 | Sat Aug 15 16:19:02.094 [initandlisten] db version v2.4.14
mongo_1 | Sat Aug 15 16:19:02.094 [initandlisten] git version: 05bebf9ab15511a71bfbded684bb226014c0a553
mongo_1 | Sat Aug 15 16:19:02.094 [initandlisten] build info: Linux ip-10-154-253-119 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
mongo_1 | Sat Aug 15 16:19:02.094 [initandlisten] allocator: tcmalloc
mongo_1 | Sat Aug 15 16:19:02.094 [initandlisten] options: {}
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] journal dir=/data/db/journal
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] recover : no journal files present, no recovery needed
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten]
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] ERROR: Insufficient free space for journal files
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] Please make at least 3379MB available in /data/db/journal or use --smallfiles
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten]
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
mongo_1 | Sat Aug 15 16:19:02.099 dbexit:
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] shutdown: going to close listening sockets...
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] shutdown: going to flush diaglog...
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] shutdown: going to close sockets...
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] shutdown: waiting for fs preallocator...
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] shutdown: lock for final commit...
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] shutdown: final commit...
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] shutdown: closing all files...
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] closeAllFiles() finished
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] journalCleanup...
mongo_1 | Sat Aug 15 16:19:02.099 [initandlisten] removeJournalFiles
mongo_1 | Sat Aug 15 16:19:02.101 [initandlisten] shutdown: removing fs lock...
mongo_1 | Sat Aug 15 16:19:02.101 dbexit: really exiting now
I am using the mongo:2.4 image and the database has very little data. I started the container successfully many times until it started having this problem.
You are probably running out of hard drive space on the boot2docker vm. This might help clean up untagged images to clear up some space: docker images --filter dangling=true -q | sort -u | xargs docker rmi.
I tried everything and I had no success until realize that /mnt/sda1 was full after accessing my boot2docker instance through docker-machine.
Seems that, sometimes, docker doesn't clean completely the containers after I remove them, so there were still some volumes there, even after the restart.
I end up using this https://github.com/chadoe/docker-cleanup-volumes to clean it up and it worked like a charm, I really think this is not a problem to be reported on this project, despite I still don't get why only the Mongo containers (I tried 3.0 and 3.1) could get this kind of error.
MongoDB gets this because they pre-allocate very large files for the database. Use docker rm -v to make sure volumes are cleaned up when deleting a container.
Hi Guys. Help me here i have installed a dockerized mongodb and meteor, and my container is increasing with a gig almost everyday. How can I handle this, see images below for reference. i want to preserve the images.

For me the problem was that I shut down my computer without shutting down the container properly.
When starting the container an internal problem happened with the mongo. I SSH'ed into the machine and deleted a lock file and then the container started all right for me.
@agamrafaeli Can you kindly elaborate where is the lock file that you mentioned in your post. I SSH'ed into the machine but am not able to track the location of the lock file you mentioned.
I'm having the same issue on:
-> Docker For Mac Version 1.12.3-beta30.1 (13946)Channel: Betaf94d037b71
-> tutum/mongodb.
Since I can't manage the VM in Docker For Mac directly as that's how it's set up, I am unable to use a few of the workarounds mentioned in https://github.com/dockerfile/mongodb/issues/9 .
The error on running 'docker-compose up' (this error is also generated by a minimal docker run command as well) was:
db_1 | [initandlisten]
db_1 | [initandlisten] ERROR: Insufficient free space for journal files
db_1 | [initandlisten] Please make at least 3379MB available in /data/db/journal or use --smallfiles
db_1 | [initandlisten]
db_1 | [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
db_1 | [initandlisten] dbexit:
db_1 | [initandlisten] shutdown: going to close listening sockets...
db_1 | [initandlisten] shutdown: going to flush diaglog...
db_1 | [initandlisten] shutdown: going to close sockets...
db_1 | [initandlisten] shutdown: waiting for fs preallocator...
db_1 | [initandlisten] shutdown: lock for final commit...
db_1 | [initandlisten] shutdown: final commit...
db_1 | [initandlisten] shutdown: closing all files...
db_1 | [initandlisten] closeAllFiles() finished
db_1 | [initandlisten] journalCleanup...
db_1 | [initandlisten] removeJournalFiles
db_1 | [initandlisten] shutdown: removing fs lock...
db_1 | [initandlisten] dbexit: really exiting now
db_1 | => Waiting for confirmation of MongoDB service startup
db_1 | => Waiting for confirmation of MongoDB service startup
db_1 | => Waiting for confirmation of MongoDB service startup
Since I'm using the new(ish) Docker For Mac app, instead of the old docker-machine approach, it's a little unclear at first glance how I'll do the workaround of rebuilding the VM, and restarting the Docker app isn't helping. Also, restarting my machine completely didn't help.
Incidentally, it didn't help to try the suggestion to run:
docker images --filter dangling=true -q | sort -u | xargs docker rmi
Closing old issue. Feel free to comment on further troubleshooting if you feel this was closed in error or on the solution to help users running into the same problem.
(related lock file issue #62)
Most helpful comment
You are probably running out of hard drive space on the boot2docker vm. This might help clean up untagged images to clear up some space:
docker images --filter dangling=true -q | sort -u | xargs docker rmi.