Problem:
I'm using the mongodb/mongodb-atlas-local Docker image in our CI/CD pipeline for running tests. While the verbose logging is acceptable for local development, it becomes problematic in CI/CD environments.
When a test fails (which happens frequently during development), we're forced to download approximately ~1GB of MongoDB logs from our CI/CD system, most of which are unnecessary for debugging the actual test failures.
I use a standard docker-compose.yml
services:
mongodb-atlas:
image: mongodb/mongodb-atlas-local:7
ports:
- "27025:27017"
volumes:
- mongodb-atlas-data:/data
environment:
- MONGODB_REPLICA_SET_NAME=rs0
networks:
test:
aliases:
- mongodb-atlas.test.com
restart: unless-stopped
networks:
test:
driver: bridge
volumes:
mongodb-atlas-data:
also I've tried overriding mongod.conf, but none of the changes take effect.
volumes:
- mongod.conf:/etc/mongod.conf:ro
Question:
Is there a way to configure the mongodb-atlas-local Docker image to reduce log verbosity?
Specifically:
- Can I set a lower log level via environment variables or configuration files?
- Is there a recommended approach for using this image in CI/CD environments?
- Are there any Docker run parameters or MongoDB configuration options that would help reduce log output?
Ideal Solution:
A configuration option that would reduce logging to only errors and warnings, or a way to disable verbose operational logs while keeping test-relevant information.
Any guidance or workarounds would be greatly appreciated!
updated:
This image is not a simple MongoDB image - it contains both MongoDB Server (mongod) and Atlas Search (mongot). It uses /usr/local/bin/runner server as the entrypoint to orchestrate starting both services, which means we cannot override the start command. The runner starts mongod with hardcoded command-line arguments rather than using a configuration file, as confirmed by db.adminCommand({ getCmdLineOpts: 1 }) showing only argv parameters without a --config flag.
{
argv: [
'mongod',
'--replSet',
'local_dev_atlas',
'--dbpath',
'/data/db',
'--keyFile',
'/data/configdb/keyfile',
'--maxConns',
'32200',
'--bind_ip_all',
'--setParameter',
'mongotHost=localhost:27027',
'--setParameter',
'searchIndexManagementHostAndPort=localhost:27027',
'--auth'
],
...
}