What is the method to determine the mongoDB version within a particular docker image?

After downloading the 7.0.14 docker image for “MongoDB packaged by Bitnami”, I would like to determine what is the MongoDB version that is package in this container. Is there a way to determine this before performing an installation?

Hi @oradba_Luv_N_A

mongod --version is the invocation to find the version of mongodb installed. This is no different in a container environment.

As expected the version matches that of the container :wink:

docker run --rm bitnami/mongodb:7.0.14 mongod --version
mongodb 00:01:16.04 INFO  ==> 
mongodb 00:01:16.04 INFO  ==> Welcome to the Bitnami mongodb container
mongodb 00:01:16.04 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
mongodb 00:01:16.05 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
mongodb 00:01:16.05 INFO  ==> Upgrade to Tanzu Application Catalog for production environments to access custom-configured and pre-packaged software components. Gain enhanced features, including Software Bill of Materials (SBOM), CVE scan result reports, and VEX documents. To learn more, visit https://bitnami.com/enterprise
mongodb 00:01:16.06 INFO  ==> 

db version v7.0.14
Build Info: {
    "version": "7.0.14",
    "gitVersion": "ce59cfc6a3c5e5c067dca0d30697edd68d4f5188",
    "openSSLVersion": "OpenSSL 3.0.14 4 Jun 2024",
    "modules": [],
    "allocator": "tcmalloc",
    "environment": {
        "distmod": "debian12",
        "distarch": "x86_64",
        "target_arch": "x86_64"
    }
}
```
3 Likes

At the current time there isn’t an environment I can use to run the command “docker run”. Thus I’m unable to apply the command “`mongod --version”. Thank you for the detail that indicated the MongoDB version is 7.0.14.

1 Like