Sign inSign up

mongocamp/mongodb

By mongocamp

Updated 6 days ago

Production-ready Docker image for MongoDB with flexible configuration via environment variables.

Image
Databases & storage
0

50K+

mongocamp/mongodb repository overview

mongocamp/mongodb:8.3.11

Docker Pulls Docker Image Size with architecture (latest by date/latest semver) Docker Image Version (latest semver)

Introduction

Git-Repository to build Docker containerimage for MongoDB.

Contributing

If you find this image helpfull, so you can see here how you can help:

  • Send a pull request with your features and bug fixes
  • Help users resolve their issues.

Issues

Before reporting your issue please try updating Docker to the latest version and check if it resolves the issue. Refer to the Docker installation guide for instructions.

If that recommendations do not help then report your issue along with the following information:

  • Output of the docker version and docker info commands
  • The docker run command or docker-compose.yml used to start the image. Mask out the sensitive bits.

Getting started

Installation

Automated builds of the image are available on Dockerhub

docker pull mongocamp/mongodb:8.3.11

Alternatively you can build the image yourself.

docker build . --tag 'mongocamp/mongodb:dev';

Quickstart

Start MongoDB using:

docker run --publish 27017:27017 mongocamp/mongodb:8.3.11

Alternatively, you can use the sample docker-compose.yml file to start the container using Docker Compose

Persistence

For MongoDB to persist the state of the container across shutdown and startup, you should mount a volume at the data directory. The container image use by default /var/lib/mongodb. You can cange the data directory with the Docker Environment Variable MONGO_DATA_DIR.

The Quickstart and docker-compose.yml Sample command or the Quickstart bash command already mounts a volume for persistence.

Environment Variables

VariableDefault ValueInformations
MONGO_DATA_DIR/var/lib/mongodb
MONGO_ROOT_USERNAMEroot
MONGO_PORT27017Specifies the TCP port on which the MongoDB
MONGO_ROOT_PWDNONEIf the param not equal NONE or "" the MongoDB authorization will enabled. The password of the MONGO_ROOT_USERNAME will be reseted on every container start.
MONGO_LOGSTDOUTEnable Loging to LogPath. Default is the stdout of the docker container, but you can also use something like /var/log/mongodb/mongo.log
MONGO_LOG_PATH/var/log/mongodbEnable Loging to LogPath REPLACED BY MONGO_LOG
MONGO_STORAGEENGINEwiredTigerValue for the storageEngine parameter
MONGO_WIREDTIGER_CACHE_SIZE_GBNONEValue for the wiredTigerCacheSizeGB parameter
MONGO_MAX_CONNECTIONSNONEValue for the maxConns parameter if not equal NONE
MONGO_REPLICA_SET_NAMENONEIf the param not equal NONE or "" set name for replSet replication options
MONGO_REPLICA_SKIP_INITfalseIf true, skip automatic rs.initiate() during startup even when MONGO_REPLICA_SET_NAME is set. Useful for adding secondary nodes to the cluster.
MONGO_BINDING--bind_ip_allip binding ip binding options
MONGO_EXTRA_ARGSYou can use every mongod commandline option
MONGO_REPLICA_KEYgenerate randomUsed for communication between replica sets Replica Set to Keyfile Authentication

Tag summary

Content type

Image

Digest

sha256:9729eaaa0

Size

286.7 MB

Last updated

6 days ago

docker pull mongocamp/mongodb