diff --git a/2.6/Dockerfile b/2.6/Dockerfile index a4d5734..4a3a43f 100644 --- a/2.6/Dockerfile +++ b/2.6/Dockerfile @@ -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 diff --git a/2.6/run.sh b/2.6/run.sh index e53c0bf..66431f6 100755 --- a/2.6/run.sh +++ b/2.6/run.sh @@ -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 diff --git a/3.0/Dockerfile b/3.0/Dockerfile index 0babbdf..d5399d5 100644 --- a/3.0/Dockerfile +++ b/3.0/Dockerfile @@ -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 diff --git a/3.0/run.sh b/3.0/run.sh index bcd9e0a..c0315cf 100755 --- a/3.0/run.sh +++ b/3.0/run.sh @@ -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 diff --git a/3.2/Dockerfile b/3.2/Dockerfile index 77fb4ec..670c233 100644 --- a/3.2/Dockerfile +++ b/3.2/Dockerfile @@ -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 diff --git a/3.2/run.sh b/3.2/run.sh index bcd9e0a..c0315cf 100755 --- a/3.2/run.sh +++ b/3.2/run.sh @@ -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 diff --git a/README.md b/README.md index f56286c..d4078c3 100644 --- a/README.md +++ b/README.md @@ -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**