Skip to content
This repository has been archived by the owner on Nov 29, 2020. It is now read-only.

Sets MongoDB to use a smaller default file size #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions 2.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ VOLUME /data/db

ENV AUTH yes
ENV JOURNALING yes
ENV SMALLFILES no

ADD run.sh /run.sh
ADD set_mongodb_password.sh /set_mongodb_password.sh
Expand Down
4 changes: 4 additions & 0 deletions 2.6/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ if [ "$OPLOG_SIZE" != "" ]; then
cmd="$cmd --oplogSize $OPLOG_SIZE"
fi

if [ "$SMALLFILES" == "yes" ]; then
cmd="$cmd --smallfiles"
fi

$cmd &

if [ ! -f /data/db/.mongodb_password_set ]; then
Expand Down
1 change: 1 addition & 0 deletions 3.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ VOLUME /data/db
ENV AUTH yes
ENV STORAGE_ENGINE wiredTiger
ENV JOURNALING yes
ENV SMALLFILES no

ADD run.sh /run.sh
ADD set_mongodb_password.sh /set_mongodb_password.sh
Expand Down
4 changes: 4 additions & 0 deletions 3.0/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ if [ "$OPLOG_SIZE" != "" ]; then
cmd="$cmd --oplogSize $OPLOG_SIZE"
fi

if [ "$SMALLFILES" == "yes" ]; then
cmd="$cmd --smallfiles"
fi

$cmd &

if [ ! -f /data/db/.mongodb_password_set ]; then
Expand Down
1 change: 1 addition & 0 deletions 3.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ VOLUME /data/db
ENV AUTH yes
ENV STORAGE_ENGINE wiredTiger
ENV JOURNALING yes
ENV SMALLFILES no

ADD run.sh /run.sh
ADD set_mongodb_password.sh /set_mongodb_password.sh
Expand Down
4 changes: 4 additions & 0 deletions 3.2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ if [ "$OPLOG_SIZE" != "" ]; then
cmd="$cmd --oplogSize $OPLOG_SIZE"
fi

if [ "$SMALLFILES" == "yes" ]; then
cmd="$cmd --smallfiles"
fi

$cmd &

if [ ! -f /data/db/.mongodb_password_set ]; then
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,13 @@ In MongoDB 3.0 the variable `OPLOG_SIZE` can be used to specify the mongod oplog

By default MongoDB allocates 5% of the available free disk space, but will always allocate at least 1 gigabyte and never more than 50 gigabytes.

Sets MongoDB to use a smaller default file size.
-----------------------------

If you want to run MongoDB with [option --smallfiles](https://docs.mongodb.com/manual/reference/program/mongod/#cmdoption--smallfiles) you can set the environment variable `SMALLFILES` as `yes`:

docker run -d -p 27017:27017 -p 28017:28017 -e SMALLFILES=yes tutum/mongodb

By default is "no".

**by http://www.tutum.co**