mongo
Mongo Overview
Secure your stack with a hardened Mongo image freshly-built by Minimus. Minimus images always include the most up-to-date package version for all packages and dependencies contained in the image.
MongoDB is a document-oriented NoSQL database used to store and manage data in flexible, JSON-like structures for scalable applications. Deploy Mongo with TLS enabled using our guide.
Try It Out
Take the Minimus Mongo image for a test run. The following command will set the root password to Minimus! but you can set any password you want:
docker run -d --name minimus-mongo \
-e MONGO_INITDB_ROOT_USERNAME=mongoadmin \
-e MONGO_INITDB_ROOT_PASSWORD=Minimus! \
reg.mini.dev/mongoOpen an interactive shell in your running container.
docker exec -it minimus-mongo shThen log into the database:
mongo -u mongoadmin -pSubmit the password you set when you ran the container. (In our example, it's Minimus!.) Once logged in, you should see Mongo status messages such as:
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("fe477f36-62e4-4785-b776-901d14aeb2ac") }
MongoDB server version: 8.0.8Ready to interact with your Mongo server?
For example, pass a command to list all databases:
show dbsYou should see something like:
> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB Run Mongo with Docker Compose
You can use a compose.yaml file to configure the Mongo database and set the appropriate environment variables.
The following variables are commonly used:
ME_CONFIG_Mongo_ADMINUSERNAME: root
ME_CONFIG_Mongo_ADMINPASSWORD: example
ME_CONFIG_Mongo_URL: Mongo://root:example@mongo:27017/
ME_CONFIG_BASICAUTH: falseTechnical Considerations
The Mongo image provided by Minimus is a slim, security-hardened alternative to the public image from Docker Hub. The images are largely interchangeable, with a few differences as noted below.
Mongo built by Minimus:
- Runs as non-root by default for a security-first approach that protects against privilege escalation attacks. The public image runs as root.
- Listens on port 27017/TCP by default without exposing it. The public image listens on and exposes port 27017/TCP by default.
- The entrypoint script is located at
/usr/bin/docker-entrypoint.sh. The public image entrypoint script is directly under the root directory. - The default working directory is
/data. The public image working directory defaults to the root directory. - The image has no default volumes. The public image defaults to
/data/configdband/data/db. - Drill down on the version specification tab to see the default user, listening ports, entrypoint, volumes, environment variables, etc.
The Payoff
A hardened, minimal image that will remain more secure for the long run and accrue vulnerabilities at a slower rate.
- See the risk reduction dashboard for a detailed CVE comparison over the past 30 days.
- Review the compliance report to see the default hardening and security configurations for the image.
Terms & Info
Trademark
This catalog is published by Minimus. All product names, logos, and marks, other than those belonging to Minimus, shown are owned by their respective rights holders and appear here only to identify the open source software each image contains. Minimus claims no ownership of those marks and implies no affiliation with, endorsement by, certification by, or sponsorship by any rights holder.
Disclaimer
Images are provided "as-is" without warranty of any kind. "Hardened" refers to the security configuration applied at the time of build and does not constitute a guarantee of ongoing security or absence of vulnerabilities. The free tier is provided without support, SLA, or guaranteed patching timelines. Security updates may be applied to paid subscriptions before or instead of free tier images. By pulling or using any image you agree to our Terms of Use.