Skip to content

Commit

Permalink
mark 2.4 deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
bparees authored and StephenCoady committed Aug 2, 2017
1 parent ba0bcb5 commit aa51dc6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 97 deletions.
88 changes: 1 addition & 87 deletions 2.4/README.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,4 @@
MongoDB Docker image
====================

This repository contains Dockerfiles for MongoDB images for general usage and OpenShift.
Users can choose between RHEL and CentOS based images.

Environment variables
---------------------------------

The image recognizes the following environment variables that you can set during
initialization by passing `-e VAR=VALUE` to the Docker run command.

| Variable name | Description |
| :------------------------ | ----------------------------------------- |
| `MONGODB_USER` | User name for MONGODB account to be created |
| `MONGODB_PASSWORD` | Password for the user account |
| `MONGODB_DATABASE` | Database name |
| `MONGODB_ADMIN_PASSWORD` | Password for the admin user |


The following environment variables influence the MongoDB configuration file. They are all optional.

| Variable name | Description | Default
| :-------------------- | ------------------------------------------------------------------------- | ----------------
| `MONGODB_NOPREALLOC` | Disable data file preallocation. | true
| `MONGODB_SMALLFILES` | Set MongoDB to use a smaller default data file size. | true
| `MONGODB_QUIET` | Runs MongoDB in a quiet mode that attempts to limit the amount of output. | true
| `MONGODB_TEXT_SEARCH_ENABLED` | Enables the [text search](https://docs.mongodb.org/v2.4/core/index-text/#text-search-text-command) feature. | false

**Notice: Do not enable or use the MONGODB_TEXT_SEARCH_ENABLED on production systems.**


You can also set the following mount points by passing the `-v /host:/container` flag to Docker.

| Volume mount point | Description |
| :-------------------------- | ---------------------- |
| `/var/lib/mongodb/data` | MongoDB data directory |

**Notice: When mouting a directory from the host into the container, ensure that the mounted
directory has the appropriate permissions and that the owner and group of the directory
matches the user UID or name which is running inside the container.**


Usage
---------------------------------

For this, we will assume that you are using the `openshift/mongodb-24-centos7` image.
If you want to set only the mandatory environment variables and store the database
in the `/home/user/database` directory on the host filesystem, execute the following command:

```
$ docker run -d -e MONGODB_USER=<user> -e MONGODB_PASSWORD=<password> -e MONGODB_DATABASE=<database> -e MONGODB_ADMIN_PASSWORD=<admin_password> -v /home/user/database:/var/lib/mongodb/data openshift/mongodb-24-centos7
```

If you are initializing the database and it's the first time you are using the
specified shared volume, the database will be created with two users: `admin` and `MONGODB_USER`. After that the MongoDB daemon
will be started. If you are re-attaching the volume to another container, the
creation of the database user and admin user will be skipped and only the
MongoDB daemon will be started.

Custom configuration file
---------------------------------

It is allowed to use custom configuration file for mongod server. Providing a custom configuration file supercedes the individual configuration environment variable values.

To use custom configuration file in container it has to be mounted into `/etc/mongod.conf`. For example to use configuration file stored in `/home/user` directory use this option for `docker run` command: `-v /home/user/mongod.conf:/etc/mongod.conf:Z`.

**Notice: Custom config file does not affect name of replica set. It has to be set in `MONGODB_REPLICA_NAME` environment variable.**

MongoDB admin user
---------------------------------

The admin user name is set to `admin` and you have to to specify the password by
setting the `MONGODB_ADMIN_PASSWORD` environment variable. This process is done
upon database initialization.


Changing passwords
------------------

Since passwords are part of the image configuration, the only supported method
to change passwords for the database user (`MONGODB_USER`) and admin user is by
changing the environment variables `MONGODB_PASSWORD` and
`MONGODB_ADMIN_PASSWORD`, respectively.

Changing database passwords directly in MongoDB will cause a mismatch between
the values stored in the variables and the actual passwords. Whenever a database
container starts it will reset the passwords to the values stored in the
environment variables.

**The MongoDB 2.4 image is deprecated.**
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Variables are documented in hack/build.sh.
BASE_IMAGE_NAME = mongodb
VERSIONS = 2.4 2.6 3.0-upg 3.2
VERSIONS = 2.6 3.0-upg 3.2
OPENSHIFT_NAMESPACES = 2.4

# Include common Makefile code.
Expand Down
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ official [OpenShift Documentation](https://docs.openshift.org/latest/using_image
Versions
---------------------------------
MongoDB versions currently provided are:
* mongodb-2.4
* mongodb-2.6
* mongodb-3.0-upg
* mongodb-3.2
Expand All @@ -34,23 +33,23 @@ Choose either the CentOS7 or RHEL7 based image:
```
$ git clone https://github.com/openshift/mongodb.git
$ cd mongodb
$ make build TARGET=rhel7 VERSION=2.4
$ make build TARGET=rhel7 VERSION=3.2
```

* **CentOS7 based image**

This image is available on DockerHub. To download it run:

```
$ docker pull openshift/mongodb-24-centos7
$ docker pull centos/mongodb-32-centos7
```

To build a MongoDB image from scratch run:

```
$ git clone https://github.com/openshift/mongodb.git
$ cd mongodb
$ make build VERSION=2.4
$ make build TARGET=centos7 VERSION=3.2
```

**Notice: By omitting the `VERSION` parameter, the build/test action will be performed
Expand All @@ -60,9 +59,6 @@ on all provided versions of MongoDB.**
Usage
---------------------------------

For information about usage of Dockerfile for MongoDB 2.4,
see [usage documentation](2.4/README.md).

For information about usage of Dockerfile for MongoDB 2.6,
see [usage documentation](2.6/README.md).

Expand All @@ -87,14 +83,14 @@ Users can choose between testing MongoDB based on a RHEL or CentOS image.

```
$ cd mongodb
$ make test TARGET=rhel7 VERSION=2.4
$ make test TARGET=rhel7 VERSION=3.2
```
* **CentOS based image**
```
$ cd mongodb
$ make test VERSION=2.4
$ make test TARGET=centos7 VERSION=3.2
```
**Notice: By omitting the `VERSION` parameter, the build/test action will be performed
Expand Down

0 comments on commit aa51dc6

Please sign in to comment.