Return to Image List

mongo

MongoDB is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemeta. MongoDB is developed by MongoDB inc.

See mongodb.com for more information

This image is built by IBM to run on the IBM Z architecture and is not affiliated with any other community that provides a version of this image.


License

View license information here

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.


Versions

Use the pull string below for the version of this image you require.
5.0.2 docker pull icr.io/ibmz/mongo@sha256:540e86824960c68525d3f7043737d587b0fb843dfdde9e04b79cb7c10ab71b22 Vulnerability Report07-27-2023
4.4.1 docker pull icr.io/ibmz/mongo@sha256:ffd897a362ef6f5be344f7a525ccbececac0cf8c496a39b8fd9bb134623cf258 Vulnerability Report10-27-2021
Version Pull String Security (IBM Cloud) Created

Usage Notes

Start a mongo server instance where some-mongo is the name you want to assign to your container and 4.4.1 is the tag specifying the MongoDB version you want. See the list above for relevant tags.

docker run --name {some-mongo} -d icr.io/ibmz/mongo:4.4.1

Connect to MongoDB from another Docker container
The MongoDB server in the image listens on the standard MongoDB port, 27017, so connecting via Docker networks will be the same as connecting to a remote mongodb. The following example starts another MongoDB container instance and runs the mongo command line client against the original MongoDB container from the example above, allowing you to execute MongoDB statements against your database instance. Replace{some-mongo} witth the name of your original mongo container.

docker run -it --network some-network --rm icr.io/ibmz/mongo:4.4.1 mongo {some-mongo} test

Using a custom MongoDB configuration file
For a more complicated configuration setup, you can still use the MongoDB configuration file. Mongodb does not read a configuration file by default, so the --config option with the path to the configuration file needs to be specified. Create a custom configuration file and put the configuration file in the container by putting it in a Docker volume and then mounting that volume to the container. See the MongoDB manual for a full list of configuration file options.

For example, the docker volume mongo-config contains the custom configuration file at /mongod.conf. Then run a icr.io/ibmz/mongo:4.4.0 container with the mongo-config volume attached and the --config /etc/mongo/mongod.conf command passed in.

docker run --name custom-mongo-container -v mongo-config:/etc/mongo/ -d icr.io/ibmz/mongo:4.4.0 \
        --config /etc/mongo/mongod.conf