diff --git a/bitnami/mongodb/8.2/debian-12/Dockerfile b/bitnami/mongodb/8.2/debian-12/Dockerfile index 942f67ff3e64..f49529b9fb17 100644 --- a/bitnami/mongodb/8.2/debian-12/Dockerfile +++ b/bitnami/mongodb/8.2/debian-12/Dockerfile @@ -7,7 +7,7 @@ ARG DOWNLOADS_URL="downloads.bitnami.com/files/stacksmith" ARG TARGETARCH LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \ - org.opencontainers.image.created="2026-02-19T03:13:13Z" \ + org.opencontainers.image.created="2026-03-11T17:46:47Z" \ org.opencontainers.image.description="Application packaged by Broadcom, Inc." \ org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/mongodb/README.md" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/mongodb" \ @@ -28,11 +28,11 @@ RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \ DOWNLOADS_URL=${SECRET_DOWNLOADS_URL:-${DOWNLOADS_URL}} ; \ mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ || exit 1 ; \ COMPONENTS=( \ - "yq-4.52.4-0-linux-${OS_ARCH}-debian-12" \ - "wait-for-port-1.0.10-7-linux-${OS_ARCH}-debian-12" \ - "render-template-1.0.9-162-linux-${OS_ARCH}-debian-12" \ + "yq-4.52.4-1-linux-${OS_ARCH}-debian-12" \ + "wait-for-port-1.0.10-8-linux-${OS_ARCH}-debian-12" \ + "render-template-1.0.9-163-linux-${OS_ARCH}-debian-12" \ "mongodb-shell-2.7.0-0-linux-${OS_ARCH}-debian-12" \ - "mongodb-8.2.5-0-linux-${OS_ARCH}-debian-12" \ + "mongodb-8.2.5-1-linux-${OS_ARCH}-debian-12" \ ) ; \ for COMPONENT in "${COMPONENTS[@]}"; do \ if [ ! -f "${COMPONENT}.tar.gz" ]; then \ @@ -53,7 +53,7 @@ COPY rootfs / RUN /opt/bitnami/scripts/mongodb/postunpack.sh ENV APP_VERSION="8.2.5" \ BITNAMI_APP_NAME="mongodb" \ - IMAGE_REVISION="1" \ + IMAGE_REVISION="2" \ PATH="/opt/bitnami/common/bin:/opt/bitnami/mongodb/bin:$PATH" EXPOSE 27017 diff --git a/bitnami/mongodb/README.md b/bitnami/mongodb/README.md index 5f9b499132ae..3c1d9d5aaa8a 100644 --- a/bitnami/mongodb/README.md +++ b/bitnami/mongodb/README.md @@ -1,7 +1,5 @@ # MongoDB® packaged by Bitnami -## What is MongoDB®? - > MongoDB® is a relational open source NoSQL database. Easy to use, it stores data in JSON-like documents. Automated scalability and high-performance. Ideal for developing cloud native applications. [Overview of MongoDB®](https://www.mongodb.org) @@ -64,32 +62,17 @@ cd bitnami/APP/VERSION/OPERATING-SYSTEM docker build -t bitnami/APP:latest . ``` +## Using `docker-compose.yaml` + +Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes. For production-ready deployments, we highly recommend utilizing its associated [Bitnami Helm chart](https://github.com/bitnami/charts/tree/main/bitnami/mongodb). + ## Persisting your database If you remove the container all your data will be lost, and the next time you run the image the database will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed. For persistence you should mount a directory at the `/bitnami/mongodb` path. If the mounted directory is empty, it will be initialized on the first run. -```console -docker run \ - -v /path/to/mongodb-persistence:/bitnami/mongodb \ - bitnami/mongodb:latest -``` - -or by modifying the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/mongodb/docker-compose.yml) file present in this repository: - -```diff - ... - services: - mongodb: - ... - volumes: -- - mongodb_data:/bitnami/mongodb -+ - /path/to/mongodb-persistence:/bitnami/mongodb - ... -``` - -> NOTE: As this is a non-root container, the mounted files and directories must have the proper permissions for the UID `1001`. +> **NOTE** As this is a non-root container, the mounted files and directories must have the proper permissions for the UID `1001`. ## Connecting to other containers @@ -97,73 +80,14 @@ Using [Docker container networking](https://docs.docker.com/engine/userguide/net Containers attached to the same network can communicate with each other using the container name as the hostname. -### Using the Command Line - -In this example, we will create a MongoDB® client instance that will connect to the server instance that is running on the same docker network as the client. - -#### Step 1: Create a network - -```console -docker network create app-tier --driver bridge -``` - -#### Step 2: Launch the MongoDB® server instance - -Use the `--network app-tier` argument to the `docker run` command to attach the MongoDB® container to the `app-tier` network. - -```console -docker run -d --name mongodb-server \ - --network app-tier \ - bitnami/mongodb:latest -``` - -#### Step 3: Launch your MongoDB® client instance - -Finally we create a new container instance to launch the MongoDB® client and connect to the server created in the previous step: - -```console -docker run -it --rm \ - --network app-tier \ - bitnami/mongodb:latest mongo --host mongodb-server -``` - -### Using a Docker Compose file - -When not specified, Docker Compose automatically sets up a new network and attaches all deployed services to that network. However, we will explicitly define a new `bridge` network named `app-tier`. In this example we assume that you want to connect to the MongoDB® server from your own custom application image which is identified in the following snippet by the service name `myapp`. - -```yaml -version: '2' - -networks: - app-tier: - driver: bridge - -services: - mongodb: - image: bitnami/mongodb:latest - networks: - - app-tier - myapp: - image: YOUR_APPLICATION_IMAGE - networks: - - app-tier -``` - -> **IMPORTANT**: -> -> 1. Please update the **YOUR_APPLICATION_IMAGE_** placeholder in the above snippet with your application image -> 2. In your application container, use the hostname `mongodb` to connect to the MongoDB® server - -Launch the containers using: - -```console -docker-compose up -d -``` - ## Configuration +The following section describes the supported environment variables + ### Environment variables +The following tables list the main variables you can set. + #### Customizable environment variables | Name | Description | Default Value | @@ -251,22 +175,6 @@ Passing extra command-line flags to the mongod service command is possible throu - `MONGODB_EXTRA_FLAGS`: Flags to be appended to the `mongod` startup command. No defaults - `MONGODB_CLIENT_EXTRA_FLAGS`: Flags to be appended to the `mongo` command which is used to connect to the (local or remote) `mongod` daemon. No defaults -```console -docker run --name mongodb -e ALLOW_EMPTY_PASSWORD=yes -e MONGODB_EXTRA_FLAGS='--wiredTigerCacheSizeGB=2' bitnami/mongodb:latest -``` - -or by modifying the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/mongodb/docker-compose.yml) file present in this repository: - -```yaml -services: - mongodb: - ... - environment: - - ALLOW_EMPTY_PASSWORD=yes - - MONGODB_EXTRA_FLAGS=--wiredTigerCacheSizeGB=2 - ... -``` - ### Configuring system log verbosity level Configuring the system log verbosity level is possible through the following env vars: @@ -274,22 +182,6 @@ Configuring the system log verbosity level is possible through the following env - `MONGODB_DISABLE_SYSTEM_LOG`: Whether to enable/disable system log on MongoDB®. Default: `false`. Possible values: `[true, false]`. - `MONGODB_SYSTEM_LOG_VERBOSITY`: MongoDB® system log verbosity level. Default: `0`. Possible values: `[0, 1, 2, 3, 4, 5]`. For more information about the verbosity levels please refer to the [MongoDB® documentation](https://docs.mongodb.com/manual/reference/configuration-options/#systemLog.verbosity) -```console -docker run --name mongodb -e ALLOW_EMPTY_PASSWORD=yes -e MONGODB_SYSTEM_LOG_VERBOSITY='3' bitnami/mongodb:latest -``` - -or by modifying the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/mongodb/docker-compose.yml) file present in this repository: - -```yaml -services: - mongodb: - ... - environment: - - ALLOW_EMPTY_PASSWORD=yes - - MONGODB_SYSTEM_LOG_VERBOSITY=3 - ... -``` - ### Using numactl In order to enable launching commands using numactl, set the `MONGODB_ENABLE_NUMACTL` variable to true. For more information on this, check the official [MongoDB documentation][() @@ -300,115 +192,29 @@ Enabling/disabling IPv6 is possible through the following env var: - `MONGODB_ENABLE_IPV6`: Whether to enable/disable IPv6 on MongoDB®. Default: `false`. Possible values: `[true, false]` -To enable IPv6 support, you can execute: - -```console -docker run --name mongodb -e ALLOW_EMPTY_PASSWORD=yes -e MONGODB_ENABLE_IPV6=yes bitnami/mongodb:latest -``` - -or by modifying the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/mongodb/docker-compose.yml) file present in this repository: - -```yaml -services: - mongodb: - ... - environment: - - ALLOW_EMPTY_PASSWORD=yes - - MONGODB_ENABLE_IPV6=yes - ... -``` - ### Enabling/disabling directoryPerDB Enabling/disabling [directoryPerDB](https://docs.mongodb.com/manual/reference/configuration-options/#storage.directoryPerDB) is possible through the following env var: - `MONGODB_ENABLE_DIRECTORY_PER_DB`: Whether to enable/disable directoryPerDB on MongoDB®. Default: `true`. Possible values: `[true, false]` -```console -docker run --name mongodb -e ALLOW_EMPTY_PASSWORD=yes -e MONGODB_ENABLE_DIRECTORY_PER_DB=yes bitnami/mongodb:latest -``` - -or by modifying the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/mongodb/docker-compose.yml) file present in this repository: - -```yaml -services: - mongodb: - ... - environment: - - ALLOW_EMPTY_PASSWORD=yes - - MONGODB_ENABLE_DIRECTORY_PER_DB=yes - ... -``` - ### Enabling/disabling journaling Enabling/disabling [journal](https://docs.mongodb.com/manual/reference/configuration-options/#mongodb-setting-storage.journal.enabled) is possible through the following env var: - `MONGODB_ENABLE_JOURNAL`: Whether to enable/disable journaling on MongoDB®. Default: `true`. Possible values: `[true, false]` -```console -docker run --name mongodb -e ALLOW_EMPTY_PASSWORD=yes -e MONGODB_ENABLE_JOURNAL=true bitnami/mongodb:latest -``` - -or by modifying the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/mongodb/docker-compose.yml) file present in this repository: - -```yaml -services: - mongodb: - ... - environment: - - ALLOW_EMPTY_PASSWORD=yes - - MONGODB_ENABLE_JOURNAL=true - ... -``` - ### Setting the root user and password on first run Passing the `MONGODB_ROOT_PASSWORD` environment variable when running the image for the first time will set the password of `MONGODB_ROOT_USER` to the value of `MONGODB_ROOT_PASSWORD` and enable authentication on the MongoDB® server. If unset, `MONGODB_ROOT_USER` defaults to `root`. -```console -docker run --name mongodb \ - -e MONGODB_ROOT_PASSWORD=password123 bitnami/mongodb:latest -``` - -or by modifying the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/mongodb/docker-compose.yml) file present in this repository: - -```yaml -services: - mongodb: - ... - environment: - - MONGODB_ROOT_PASSWORD=password123 - ... -``` - The `MONGODB_ROOT_USER` user is configured to have full administrative access to the MongoDB® server. When `MONGODB_ROOT_PASSWORD` is not specified the server allows unauthenticated and unrestricted access. ### Creating a user and database on first run You can create a user with restricted access to a database while starting the container for the first time. To do this, provide the `MONGODB_USERNAME`, `MONGODB_PASSWORD` and `MONGODB_DATABASE` environment variables. -```console -docker run --name mongodb \ - -e MONGODB_USERNAME=my_user -e MONGODB_PASSWORD=password123 \ - -e MONGODB_DATABASE=my_database bitnami/mongodb:latest -``` - -or by modifying the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/mongodb/docker-compose.yml) file present in this repository: - -```yaml -services: - mongodb: - ... - environment: - - MONGODB_USERNAME=my_user - - MONGODB_PASSWORD=password123 - - MONGODB_DATABASE=my_database - ... -``` - -**Note!** -Creation of a user enables authentication on the MongoDB® server and as a result unauthenticated access by *any* user is not permitted. +> **NOTE** Creation of a user enables authentication on the MongoDB® server and as a result unauthenticated access by *any* user is not permitted. ### Setting up replication @@ -429,185 +235,7 @@ A [replication](https://docs.mongodb.com/manual/replication/) cluster can easily In a replication cluster you can have one primary node, zero or more secondary nodes and zero or one arbiter node. -> **Note**: The total number of nodes on a replica set scenario cannot be higher than 8 (1 primary, 6 secondaries and 1 arbiter) - -#### Step 1: Create the replication primary - -The first step is to start the MongoDB® primary. - -```console -docker run --name mongodb-primary \ - -e MONGODB_REPLICA_SET_MODE=primary \ - -e MONGODB_ADVERTISED_HOSTNAME=mongodb-primary \ - -e MONGODB_ROOT_PASSWORD=password123 \ - -e MONGODB_REPLICA_SET_KEY=replicasetkey123 \ - bitnami/mongodb:latest -``` - -In the above command the container is configured as the `primary` using the `MONGODB_REPLICA_SET_MODE` parameter. - -#### Step 2: Create the replication secondary node - -Next we start a MongoDB® secondary container. - -```console -docker run --name mongodb-secondary \ - --link mongodb-primary:primary \ - -e MONGODB_REPLICA_SET_MODE=secondary \ - -e MONGODB_ADVERTISED_HOSTNAME=mongodb-secondary \ - -e MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary \ - -e MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017 \ - -e MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password123 \ - -e MONGODB_REPLICA_SET_KEY=replicasetkey123 \ - bitnami/mongodb:latest -``` - -In the above command the container is configured as a `secondary` using the `MONGODB_REPLICA_SET_MODE` parameter. The `MONGODB_INITIAL_PRIMARY_HOST` and `MONGODB_INITIAL_PRIMARY_PORT_NUMBER` parameters are used connect and with the MongoDB® primary. - -#### Step 3: Create a replication arbiter node - -Finally we start a MongoDB® arbiter container. - -```console -docker run --name mongodb-arbiter \ - --link mongodb-primary:primary \ - -e MONGODB_REPLICA_SET_MODE=arbiter \ - -e MONGODB_ADVERTISED_HOSTNAME=mongodb-arbiter \ - -e MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary \ - -e MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017 \ - -e MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password123 \ - -e MONGODB_REPLICA_SET_KEY=replicasetkey123 \ - bitnami/mongodb:latest -``` - -In the above command the container is configured as a `arbiter` using the `MONGODB_REPLICA_SET_MODE` parameter. The `MONGODB_INITIAL_PRIMARY_HOST` and `MONGODB_INITIAL_PRIMARY_PORT_NUMBER` parameters are used connect and with the MongoDB® primary. - -You now have a three node MongoDB® replication cluster up and running which can be scaled by adding/removing secondaries. - -#### Optional: Create a replication hidden node - -If we want a replication hidden node, we start a MongoDB® hidden container. - -```console -docker run --name mongodb-hidden \ - --link mongodb-primary:primary \ - -e MONGODB_REPLICA_SET_MODE=hidden \ - -e MONGODB_ADVERTISED_HOSTNAME=mongodb-hidden \ - -e MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary \ - -e MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017 \ - -e MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password123 \ - -e MONGODB_REPLICA_SET_KEY=replicasetkey123 \ - bitnami/mongodb:latest -``` - -In the above command the container is configured as a `hidden` using the `MONGODB_REPLICA_SET_MODE` parameter. The `MONGODB_INITIAL_PRIMARY_HOST` and `MONGODB_INITIAL_PRIMARY_PORT_NUMBER` parameters are used connect and with the MongoDB® primary. - -With Docker Compose the replicaset can be setup using: - -```yaml -version: '2' - -services: - mongodb-primary: - image: bitnami/mongodb:latest - environment: - - MONGODB_ADVERTISED_HOSTNAME=mongodb-primary - - MONGODB_REPLICA_SET_MODE=primary - - MONGODB_ROOT_PASSWORD=password123 - - MONGODB_REPLICA_SET_KEY=replicasetkey123 - - volumes: - - mongodb_master_data:/bitnami - - mongodb-secondary: - image: bitnami/mongodb:latest - depends_on: - - mongodb-primary - environment: - - MONGODB_ADVERTISED_HOSTNAME=mongodb-secondary - - MONGODB_REPLICA_SET_MODE=secondary - - MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary - - MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017 - - MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password123 - - MONGODB_REPLICA_SET_KEY=replicasetkey123 - - mongodb-arbiter: - image: bitnami/mongodb:latest - depends_on: - - mongodb-primary - environment: - - MONGODB_ADVERTISED_HOSTNAME=mongodb-arbiter - - MONGODB_REPLICA_SET_MODE=arbiter - - MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary - - MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017 - - MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password123 - - MONGODB_REPLICA_SET_KEY=replicasetkey123 - -volumes: - mongodb_master_data: - driver: local -``` - -and run docker-compose using: - -```console -docker-compose up --detach -``` - -In the case you want to scale the number of secondary nodes using the docker-compose parameter `--scale`, the MONGODB_ADVERTISED_HOSTNAME must not be set in mongodb-secondary and mongodb-arbiter defintions. - -```yaml -version: '2' - -services: - mongodb-primary: - image: bitnami/mongodb:latest - environment: - - MONGODB_ADVERTISED_HOSTNAME=mongodb-primary - - MONGODB_REPLICA_SET_MODE=primary - - MONGODB_ROOT_PASSWORD=password123 - - MONGODB_REPLICA_SET_KEY=replicasetkey123 - - volumes: - - mongodb_master_data:/bitnami - - mongodb-secondary: - image: bitnami/mongodb:latest - depends_on: - - mongodb-primary - environment: - - MONGODB_REPLICA_SET_MODE=secondary - - MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary - - MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017 - - MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password123 - - MONGODB_REPLICA_SET_KEY=replicasetkey123 - - mongodb-arbiter: - image: bitnami/mongodb:latest - depends_on: - - mongodb-primary - environment: - - MONGODB_REPLICA_SET_MODE=arbiter - - MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary - - MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017 - - MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password123 - - MONGODB_REPLICA_SET_KEY=replicasetkey123 - -volumes: - mongodb_master_data: - driver: local -``` - -And then run docker-compose using: - -```console -docker-compose up --detach --scale mongodb-primary=1 --scale mongodb-secondary=3 --scale mongodb-arbiter=1 -``` - -The above command scales up the number of secondary nodes to `3`. You can scale down in the same way. - -> **Note**: You should not scale up/down the number of primary nodes. Always have only one primary node running. -> **Note**: In this case, the client has to be in the same docker network to be able to reach all the nodes. +> **NOTE**: The total number of nodes on a replica set scenario cannot be higher than 8 (1 primary, 6 secondaries and 1 arbiter) #### How is a replica set configured? @@ -648,54 +276,6 @@ Before starting the cluster you need to generate PEM certificates as required by Another option would be to use letsencrypt certificates; the required configuration steps for that scenario are left as an exercise for the user and are beyond the scope of this README. -#### Generating self-signed certificates - -- Generate a new private key which will be used to create your own Certificate Authority (CA): - -```console -openssl genrsa -out mongoCA.key 2048 -``` - -- Create the public certificate for your own CA: - -```console -openssl req -x509 -new \ - -subj "/C=US/ST=NY/L=New York/O=Example Corp/OU=IT Department/CN=mongoCA" \ - -key mongoCA.key -out mongoCA.crt -``` - -- Create a Certificate Signing Request for a node `${NODE_NAME}`, the essential part here is that the `Common Name` corresponds to the hostname by which the nodes will be addressed. -Example for `mongodb-primary`: - -```console -export NODE_NAME=mongodb-primary -openssl req -new -nodes \ - -subj "/C=US/ST=NY/L=New York/O=Example Corp/OU=IT Department/CN=${NODE_NAME}" \ - -keyout ${NODE_NAME}.key -out ${NODE_NAME}.csr -``` - -- Create a certificate from the Certificate Signing Request and sign it using the private key of your previously created Certificate Authority: - -```console -openssl x509 \ - -req -days 365 -in ${NODE_NAME}.csr -out ${NODE_NAME}.crt \ - -CA mongoCA.crt -CAkey mongoCA.key -CAcreateserial -extensions req -``` - -- Create a PEM bundle using the private key and the public certificate: - -```console -cat ${NODE_NAME}.key ${NODE_NAME}.crt > ${NODE_NAME}.pem -``` - -NB: Afterwards you do not need the Certificate Signing Request. - -```console -rm ${NODE_NAME}.csr -``` - -Repeat the process to generate PEM bundles for all the nodes in your cluster. - #### Starting the cluster After having generated the certificates and making them available to the containers at the correct mount points (i.e. `/certificates/`), the environment variables could be setup as in the following examples. @@ -733,49 +313,6 @@ Especially client authentication and requirements for common name and OU/DN/etc. The image looks for mounted configurations files in `/bitnami/mongodb/conf/`. You can mount a volume at `/bitnami/mongodb/conf/` and copy/edit the configurations in the `/path/to/mongodb-configuration-persistence/`. The default configurations will be populated to the `/opt/bitnami/mongodb/conf/` directory if it's empty. -#### Step 1: Run the MongoDB® image - -Run the MongoDB® image, mounting a directory from your host. - -```console -docker run --name mongodb -v /path/to/mongodb-configuration-persistence:/bitnami/mongodb/conf bitnami/mongodb:latest -``` - -or using Docker Compose: - -```diff - ... - services: - mongodb: - ... - volumes: - - mongodb_data:/bitnami/mongodb -+ - /path/to/mongodb-configuration-persistence:/bitnami/mongodb/conf - ... -``` - -#### Step 2: Edit the configuration - -Edit the configuration on your host using your favorite editor. - -```console -vi /path/to/mongodb-configuration-persistence/mongodb.conf -``` - -#### Step 3: Restart MongoDB® - -After changing the configuration, restart your MongoDB® container for changes to take effect. - -```console -docker restart mongodb -``` - -or using Docker Compose: - -```console -docker-compose restart mongodb -``` - Refer to the [configuration file options](http://docs.mongodb.org/v2.4/reference/configuration-options/) manual for the complete list of MongoDB® configuration options. ### FIPS configuration in Bitnami Secure Images @@ -800,68 +337,6 @@ docker-compose logs mongodb You can configure the containers [logging driver](https://docs.docker.com/engine/admin/logging/overview/) using the `--log-driver` option if you wish to consume the container logs differently. In the default configuration docker uses the `json-file` driver. -## Maintenance - -### Upgrade this image - -Bitnami provides up-to-date versions of MongoDB®, including security patches, soon after they are made upstream. We recommend that you follow these steps to upgrade your container. - -#### Step 1: Get the updated image - -```console -docker pull bitnami/mongodb:latest -``` - -or if you're using Docker Compose, update the value of the image property to `bitnami/mongodb:latest`. - -#### Step 2: Stop and backup the currently running container - -Stop the currently running container using the command - -```console -docker stop mongodb -``` - -or using Docker Compose: - -```console -docker-compose stop mongodb -``` - -Next, take a snapshot of the persistent volume `/path/to/mongodb-persistence` using: - -```console -rsync -a /path/to/mongodb-persistence /path/to/mongodb-persistence.bkp.$(date +%Y%m%d-%H.%M.%S) -``` - -You can use this snapshot to restore the database state should the upgrade fail. - -#### Step 3: Remove the currently running container - -```console -docker rm -v mongodb -``` - -or using Docker Compose: - -```console -docker-compose rm -v mongodb -``` - -#### Step 4: Run the new image - -Re-create your container from the new image. - -```console -docker run --name mongodb bitnami/mongodb:latest -``` - -or using Docker Compose: - -```console -docker-compose up mongodb -``` - ## Notable Changes ### 4.4.8-debian-10-r31, and 5.0.2-debian-10-r0 @@ -897,12 +372,6 @@ docker-compose up mongodb - All volumes have been merged at `/bitnami/mongodb`. Now you only need to mount a single volume at `/bitnami/mongodb` for persistence. - The logs are always sent to the `stdout` and are no longer collected in the volume. -## Using `docker-compose.yaml` - -Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes. For production-ready deployments, we highly recommend utilizing its associated [Bitnami Helm chart](https://github.com/bitnami/charts/tree/main/bitnami/mongodb). - -If you detect any issue in the `docker-compose.yaml` file, feel free to report it or contribute with a fix by following our [Contributing Guidelines](https://github.com/bitnami/containers/blob/main/CONTRIBUTING.md). - ## License Copyright © 2026 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.