专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像
专业版
轩辕镜像 官方专业版
轩辕镜像
专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题轩辕镜像免费版
其他
关于我们网站地图
热门搜索:
mongodb

bitnami/mongodb

自动构建
Bitnami Secure Images(VMware Tanzu)

Bitnami MongoDB安全镜像是一款针对MongoDB数据库精心打造的预配置解决方案,集成全面安全加固措施、性能优化组件及跨平台兼容性,旨在帮助用户快速部署稳定可靠的MongoDB环境,其遵循企业级安全标准,包含自动更新机制、访问控制策略及数据加密功能,有效保障数据完整性与系统安全性,同时简化安装配置流程,支持一键部署至各类云平台或本地服务器,适用于从小型项目到大型企业级应用的多样化场景,为开发者和运维人员提供高效、安全、便捷的数据库运行环境。

267 次收藏下载次数: 0状态:自动构建维护者:Bitnami Secure Images(VMware Tanzu)仓库类型:镜像最近更新:10 天前
使用轩辕镜像,把时间还给真正重要的事。点击查看
DockerHub 官方简介
轩辕镜像中文简介
标签下载
镜像标签列表与下载命令
使用轩辕镜像,把时间还给真正重要的事。点击查看

MongoDB® packaged by Bitnami

MongoDB® is a relational open source NoSQL database. Easy to use, it stores data in JSON-like documents. Automated scalability and high-performance. Ideal for developing cloud native applications.

Overview of MongoDB® Disclaimer: The respective trademarks mentioned in the offering are owned by the respective companies. We do not provide a commercial license for any of these products. This listing has an open-source license. MongoDB(R) is run and maintained by MongoDB, which is a completely separate project from Bitnami.

TL;DR

console
docker run --name mongodb REGISTRY_NAME/bitnami/mongodb:latest

Note: You need to substitute the REGISTRY_NAME placeholder with a reference to your container registry.

How to deploy MongoDB® in Kubernetes?

Deploying Bitnami applications as Helm Charts is the easiest way to get started with our applications on Kubernetes. Read more about the installation in the https://github.com/bitnami/charts/tree/master/bitnami/mongodb.

Why use a non-root container?

Non-root container images add an extra layer of security and are generally recommended for production environments. However, because they run as a non-root user, privileged tasks are typically off-limits. Learn more about non-root containers in our docs.

Supported tags and respective Dockerfile links

Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags in our documentation page.

Get this image

The recommended way to get the Bitnami MongoDB® Docker Image is to pull the prebuilt image from the https://hub.docker.com/r/bitnami/mongodb.

console
docker pull REGISTRY_NAME/bitnami/mongodb:latest

To use a specific version, you can pull a versioned tag. You can view the https://hub.docker.com/r/bitnami/mongodb/tags/ in the Docker Hub Registry.

console
docker pull REGISTRY_NAME/bitnami/mongodb:[TAG]

If you wish, you can also build the image yourself by cloning the repository, changing to the directory containing the Dockerfile and executing the docker build command. Remember to replace the APP, VERSION and OPERATING-SYSTEM path placeholders in the example command below with the correct values.

console
git clone https://github.com/bitnami/containers.git
cd bitnami/APP/VERSION/OPERATING-SYSTEM
docker build -t REGISTRY_NAME/bitnami/APP:latest .

Using docker-compose.yaml

Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes. For production-ready deployments, we highly recommend utilizing its associated https://github.com/bitnami/charts/tree/main/bitnami/mongodb.

Persisting your database

If you remove the container all your data will be lost, and the next time you run the image the database will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed.

For persistence you should mount a directory at the /bitnami/mongodb path. If the mounted directory is empty, it will be initialized on the first run.

NOTE As this is a non-root container, the mounted files and directories must have the proper permissions for the UID 1001.

Connecting to other containers

Using Docker container networking, a MongoDB® server running inside a container can easily be accessed by your application containers.

Containers attached to the same network can communicate with each other using the container name as the hostname.

Configuration

The following section describes the supported environment variables

Environment variables

The following tables list the main variables you can set.

Customizable environment variables

NameDescriptionDefault Value
MONGODB_MOUNTED_CONF_DIRDirectory for including custom configuration files (that override the default generated ones)${MONGODB_VOLUME_DIR}/conf
MONGODB_INIT_RETRY_ATTEMPTSMaximum retries for checking the service initialization status7
MONGODB_INIT_RETRY_DELAYTime (in seconds) to wait between retries for checking the service initialization status5
MONGODB_PORT_NUMBERMongoDB port$MONGODB_DEFAULT_PORT_NUMBER
MONGODB_EXTRA_FLAGSExtra flags for MongoDB initializationnil
MONGODB_ENABLE_NUMACTLExecute commands using numactlfalse
MONGODB_SHELL_EXTRA_FLAGSExtra flags when using the mongodb client during initialization (useful when mounting init scripts)nil
MONGODB_ADVERTISED_HOSTNAMEHostname to use for advertising the MongoDB servicenil
MONGODB_ADVERTISE_IPWhether advertised hostname is set to container ipfalse
MONGODB_ADVERTISED_PORT_NUMBERMongoDB advertised port number. It is recommended to pass this environment variable if you have a proxy port forwarding requests to container.nil
MONGODB_DISABLE_JAVASCRIPTDisable MongoDB server-side javascript executionno
MONGODB_ENABLE_JOURNALEnable MongoDB journalnil
MONGODB_DISABLE_SYSTEM_LOGDisable MongoDB daemon system lognil
MONGODB_ENABLE_DIRECTORY_PER_DBUse a separate folder for storing each database datanil
MONGODB_ENABLE_IPV6Use IPv6 for database connectionsnil
MONGODB_SYSTEM_LOG_VERBOSITYMongoDB daemon log levelnil
MONGODB_ROOT_USERUser name for the MongoDB root userroot
MONGODB_ROOT_PASSWORDPassword for the MongoDB root usernil
MONGODB_USERNAMEUser to generate at initialization timenil
MONGODB_PASSWORDPassword for the non-root user specified in MONGODB_USERNAMEnil
MONGODB_DATABASEName of the database to create at initialization timenil
MONGODB_METRICS_USERNAMEUser used for metrics collection, for example with mongodb_exporternil
MONGODB_METRICS_PASSWORDPassword for the non-root user specified in MONGODB_METRICS_USERNAMEnil
MONGODB_EXTRA_USERNAMESComma or semicolon separated list of extra users to be created.nil
MONGODB_EXTRA_PASSWORDSComma or semicolon separated list of passwords for the users specified in MONGODB_EXTRA_USERNAMES.nil
MONGODB_EXTRA_DATABASESComma or semicolon separated list of databases to create at initialization time for the users specified in MONGODB_EXTRA_USERNAMES.nil
ALLOW_EMPTY_PASSWORDPermit accessing MongoDB without setting any passwordno
MONGODB_REPLICA_SET_MODEMongoDB replica set mode. Can be one of primary, secondary or arbiternil
MONGODB_REPLICA_SET_NAMEName of the MongoDB replica set$MONGODB_DEFAULT_REPLICA_SET_NAME
MONGODB_REPLICA_SET_KEYMongoDB replica set keynil
MONGODB_INITIAL_PRIMARY_HOSTHostname of the replica set primary node (necessary for arbiter and secondary nodes)nil
MONGODB_INITIAL_PRIMARY_PORT_NUMBERPort of the replica set primary node (necessary for arbiter and secondary nodes)27017
MONGODB_INITIAL_PRIMARY_ROOT_PASSWORDPrimary node root user password (necessary for arbiter and secondary nodes)nil
MONGODB_INITIAL_PRIMARY_ROOT_USERPrimary node root username (necessary for arbiter and secondary nodes)root
MONGODB_SET_SECONDARY_OKMark node as readable. Necessary for cases where the PVC is lostno
MONGODB_DISABLE_ENFORCE_AUTHBy default, MongoDB authentication will be enforced. If set to true, MongoDB will not enforce authenticationfalse

Read-only environment variables

NameDescriptionValue
MONGODB_VOLUME_DIRPersistence base directory$BITNAMI_VOLUME_DIR/mongodb
MONGODB_BASE_DIRMongoDB installation directory$BITNAMI_ROOT_DIR/mongodb
MONGODB_CONF_DIRMongoDB configuration directory$MONGODB_BASE_DIR/conf
MONGODB_DEFAULT_CONF_DIRMongoDB default configuration directory$MONGODB_BASE_DIR/conf.default
MONGODB_LOG_DIRMongoDB logs directory$MONGODB_BASE_DIR/logs
MONGODB_DATA_DIRMongoDB data directory${MONGODB_VOLUME_DIR}/data
MONGODB_TMP_DIRMongoDB temporary directory$MONGODB_BASE_DIR/tmp
MONGODB_BIN_DIRMongoDB executables directory$MONGODB_BASE_DIR/bin
MONGODB_TEMPLATES_DIRDirectory where the mongodb.conf template file is stored$MONGODB_BASE_DIR/templates
MONGODB_MONGOD_TEMPLATES_FILEPath to the mongodb.conf template file$MONGODB_TEMPLATES_DIR/mongodb.conf.tpl
MONGODB_CONF_FILEPath to MongoDB configuration file$MONGODB_CONF_DIR/mongodb.conf
MONGODB_KEY_FILEPath to the MongoDB replica set keyfile$MONGODB_CONF_DIR/keyfile
MONGODB_DB_SHELL_FILEPath to MongoDB dbshell file/.dbshell
MONGODB_RC_FILEPath to MongoDB rc file/.mongorc.js
MONGOSH_DIRPath to mongosh directory/.mongodb
MONGOSH_RC_FILEPath to mongosh rc file/.mongoshrc.js
MONGODB_PID_FILEPath to the MongoDB PID file$MONGODB_TMP_DIR/mongodb.pid
MONGODB_LOG_FILEPath to the MongoDB log file$MONGODB_LOG_DIR/mongodb.log
MONGODB_INITSCRIPTS_DIRPath to the MongoDB container init scripts directory/docker-entrypoint-initdb.d
MONGODB_DAEMON_USERMongoDB system usermongo
MONGODB_DAEMON_GROUPMongoDB system groupmongo
MONGODB_DEFAULT_PORT_NUMBERMongoDB port set at build time27017
MONGODB_DEFAULT_ENABLE_JOURNALEnable MongoDB journal at build timetrue
MONGODB_DEFAULT_DISABLE_SYSTEM_LOGDisable MongoDB daemon system log set at build timefalse
MONGODB_DEFAULT_ENABLE_DIRECTORY_PER_DBUse a separate folder for storing each database data set at build timefalse
MONGODB_DEFAULT_ENABLE_IPV6Use IPv6 for database connections set at build timefalse
MONGODB_DEFAULT_SYSTEM_LOG_VERBOSITYMongoDB daemon log level set at build time0
MONGODB_DEFAULT_REPLICA_SET_NAMEName of the MongoDB replica set at build timereplicaset

Initializing a new instance

When the container is executed for the first time, it will execute the files with extensions .sh, and .js located at /docker-entrypoint-initdb.d.

In order to have your custom files inside the docker image you can mount them as a volume.

Passing extra command-line flags to mongod startup

Passing extra command-line flags to the mongod service command is possible through the following env var:

  • MONGODB_EXTRA_FLAGS: Flags to be appended to the mongod startup command. No defaults
  • MONGODB_CLIENT_EXTRA_FLAGS: Flags to be appended to the mongo command which is used to connect to the (local or remote) mongod daemon. No defaults

Configuring system log verbosity level

Configuring the system log verbosity level is possible through the following env vars:

  • MONGODB_DISABLE_SYSTEM_LOG: Whether to enable/disable system log on MongoDB®. Default: false. Possible values: [true, false].
  • MONGODB_SYSTEM_LOG_VERBOSITY: MongoDB® system log verbosity level. Default: 0. Possible values: [0, 1, 2, 3, 4, 5]. For more information about the verbosity levels please refer to the MongoDB® documentation

Using numactl

In order to enable launching commands using numactl, set the MONGODB_ENABLE_NUMACTL variable to true. For more information on this, check the official MongoDB documentation

Enabling/disabling IPv6

Enabling/disabling IPv6 is possible through the following env var:

  • MONGODB_ENABLE_IPV6: Whether to enable/disable IPv6 on MongoDB®. Default: false. Possible values: [true, false]

Enabling/disabling directoryPerDB

Enabling/disabling [directoryPerDB is possible through the following env var:

  • MONGODB_ENABLE_DIRECTORY_PER_DB: Whether to enable/disable directoryPerDB on MongoDB®. Default: true. Possible values: [true, false]

Enabling/disabling journaling

Enabling/disabling journal is possible through the following env var:

  • MONGODB_ENABLE_JOURNAL: Whether to enable/disable journaling on MongoDB®. Default: true. Possible values: [true, false]

Setting the root user and password on first run

Passing the MONGODB_ROOT_PASSWORD environment variable when running the image for the first time will set the password of MONGODB_ROOT_USER to the value of MONGODB_ROOT_PASSWORD and enable authentication on the MongoDB® server. If unset, MONGODB_ROOT_USER defaults to root.

The MONGODB_ROOT_USER user is configured to have full administrative access to the MongoDB® server. When MONGODB_ROOT_PASSWORD is not specified the server allows unauthenticated and unrestricted access.

Creating a user and database on first run

You can create a user with restricted access to a database while starting the container for the first time. To do this, provide the MONGODB_USERNAME, MONGODB_PASSWORD and MONGODB_DATABASE environment variables.

NOTE Creation of a user enables authentication on the MongoDB® server and as a result unauthenticated access by any user is not permitted.

Setting up replication

A replication cluster can easily be setup with the Bitnami MongoDB® Docker Image using the following environment variables:

  • MONGODB_REPLICA_SET_MODE: The replication mode. Possible values primary/secondary/arbiter. No defaults.
  • MONGODB_REPLICA_SET_NAME: MongoDB® replica set name. Default: replicaset
  • MONGODB_PORT_NUMBER: The port each MongoDB® will use. Default: 27017
  • MONGODB_INITIAL_PRIMARY_HOST: MongoDB® initial primary host, once the replicaset is created any node can be eventually promoted to be the primary. No defaults.
  • MONGODB_INITIAL_PRIMARY_PORT_NUMBER: MongoDB® initial primary node port, as seen by other nodes. Default: 27017
  • MONGODB_ADVERTISED_HOSTNAME: MongoDB® advertised hostname. No defaults. It is recommended to pass this environment variable if you experience issues with ephemeral IPs. Setting this env var makes the nodes of the replica set to be configured with a hostname instead of the machine IP.
  • MONGODB_ADVERTISE_IP: MongoDB® advertised hostname is set to container ip. Default: false. Overrides MONGODB_ADVERTISED_HOSTNAME
  • MONGODB_ADVERTISED_PORT_NUMBER: MongoDB® advertised port number. No defaults. It is recommended to pass this environment variable if you have a proxy port forwarding requests to container.
  • MONGODB_REPLICA_SET_KEY: MongoDB® replica set key. Length should be greater than 5 characters and should not contain any special characters. Required for all nodes. No default.
  • MONGODB_ROOT_USER: MongoDB® root user name. Default: root.
  • MONGODB_ROOT_PASSWORD: MongoDB® root password. No defaults. Only for primary node.
  • MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD: MongoDB® initial primary root password. No defaults. Only for secondaries and arbiter nodes.

In a replication cluster you can have one primary node, zero or more secondary nodes and zero or one arbiter node.

NOTE: The total number of nodes on a replica set scenario cannot be higher than 8 (1 primary, 6 secondaries and 1 arbiter)

How is a replica set configured?

There are four different roles in a replica set configuration (primary, secondary, hidden or arbiter). Each one of these roles are configured in a different way:

Primary node configuration:

The replica set is started with the rs.initiate() command and some configuration options to force the primary to be the primary. Basically, the priority is increased from the default (1) to

_Note: the README for this container is longer than the DockerHub length limit of 25000, so it has been trimmed. The full README can be found at [***]

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 mongodb 镜像标签

docker pull docker.xuanyuan.run/bitnami/mongodb:<标签>

使用方法:

  • 登录认证方式
  • 免认证方式

DockerHub 原生拉取命令

docker pull bitnami/mongodb:<标签>

更多 mongodb 镜像推荐

mongodb/mongodb-community-server logo

mongodb/mongodb-community-server

mongodb
官方MongoDB社区服务器是由MongoDB公司推出的免费开源文档数据库服务,专为开发者与技术社区打造,支持以JSON格式存储灵活的非结构化及半结构化数据,具备高可扩展性、易部署性和丰富的查询功能,广泛应用于Web开发、大数据分析、移动应用后端等场景,为用户提供高效的数据管理解决方案并促进社区协作与技术交流。
184 次收藏1000万+ 次下载
4 天前更新
mongodb/mongodb-atlas-local logo

mongodb/mongodb-atlas-local

mongodb
通过Docker创建、管理和自动化MongoDB Atlas Local资源
12 次收藏500万+ 次下载
5 天前更新
mongodb/mongodb-enterprise-server logo

mongodb/mongodb-enterprise-server

mongodb
MongoDB官方企业高级服务器是面向企业级应用的高性能、可扩展文档数据库服务器,支持复杂查询、分布式部署与实时数据分析,提供企业级安全特性(如身份验证、数据加密)、完善的数据备份与恢复机制及专业监控工具,助力企业构建稳定高效的现代应用架构,满足大规模数据存储、处理与业务创新需求。
15 次收藏500万+ 次下载
4 天前更新
mongodb/mongodb-atlas-kubernetes-operator logo

mongodb/mongodb-atlas-kubernetes-operator

mongodb
MongoDB Atlas Kubernetes Operator - 基于Kubernetes原生管理MongoDB Atlas基础设施
5 次收藏100万+ 次下载
4 天前更新
mongodb/mongodb-mcp-server logo

mongodb/mongodb-mcp-server

mongodb
官方MongoDB MCP服务器镜像,用于部署和运行MongoDB MCP服务,提供官方支持的可靠运行环境。
3 次收藏10万+ 次下载
4 天前更新
mongodb/mongodb-atlas-search logo

mongodb/mongodb-atlas-search

mongodb
Atlas Search提供无缝、可扩展的体验,用于构建基于相关性的应用功能。
4 次收藏100万+ 次下载
24 天前更新

查看更多 mongodb 相关镜像

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

Docker 配置

登录仓库拉取

通过 Docker 登录认证访问私有仓库

专属域名拉取

无需登录使用专属域名

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

Harbor 镜像源配置

Harbor Proxy Repository 对接专属域名

Portainer 镜像源配置

Portainer Registries 加速拉取

Nexus 镜像源配置

Nexus3 Docker Proxy 内网缓存

系统配置

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

MacOS OrbStack

MacOS OrbStack 容器配置

Docker Compose

Docker Compose 项目配置

NAS 设备

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

极空间

极空间 NAS 系统配置服务

网络设备

爱快路由

爱快 iKuai 路由系统配置

宝塔面板

在宝塔面板一键配置镜像

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

使用与功能问题

配置了专属域名后,docker search 为什么会报错?

docker search 限制

Docker Hub 上有的镜像,为什么在轩辕镜像网站搜不到?

站内搜不到镜像

机器不能直连外网时,怎么用 docker save / load 迁镜像?

离线 save/load

docker pull 拉插件报错(plugin v1+json)怎么办?

插件要用 plugin install

WSL 里 Docker 拉镜像特别慢,怎么排查和优化?

WSL 拉取慢

轩辕镜像安全吗?如何用 digest 校验镜像没被篡改?

安全与 digest

第一次用轩辕镜像拉 Docker 镜像,要怎么登录和配置?

新手拉取配置

轩辕镜像合规吗?轩辕镜像的合规是怎么做的?

镜像合规机制

错误码与失败问题

docker pull 提示 manifest unknown 怎么办?

manifest unknown

docker pull 提示 no matching manifest 怎么办?

no matching manifest(架构)

镜像已拉取完成,却提示 invalid tar header 或 failed to register layer 怎么办?

invalid tar header(解压)

Docker pull 时 HTTPS / TLS 证书验证失败怎么办?

TLS 证书失败

Docker pull 时 DNS 解析超时或连不上仓库怎么办?

DNS 超时

docker 无法连接轩辕镜像域名怎么办?

域名连通性排查

Docker 拉取出现 410 Gone 怎么办?

410 Gone 排查

出现 402 或「流量用尽」提示怎么办?

402 与流量用尽

Docker 拉取提示 UNAUTHORIZED(401)怎么办?

401 认证失败

遇到 429 Too Many Requests(请求太频繁)怎么办?

429 限流

docker login 提示 Cannot autolaunch D-Bus,还算登录成功吗?

D-Bus 凭证提示

为什么会出现「单层超过 20GB」或 413,无法加速拉取?

413 与超大单层

账号 / 计费 / 权限

轩辕镜像免费版和专业版有什么区别?

免费版与专业版区别

轩辕镜像支持哪些 Docker 镜像仓库?

支持的镜像仓库

镜像拉取失败还会不会扣流量?

失败是否计费

麒麟 V10 / 统信 UOS 提示 KYSEC 权限不够怎么办?

KYSEC 拦截脚本

如何在轩辕镜像申请开具发票?

申请开票

怎么修改轩辕镜像的网站登录和仓库登录密码?

修改登录密码

如何注销轩辕镜像账户?要注意什么?

注销账户

配置与原理类

写了 registry-mirrors,为什么还是走官方或仍然报错?

mirrors 不生效

怎么用 docker tag 去掉镜像名里的轩辕域名前缀?

去掉域名前缀

如何拉取指定 CPU 架构的镜像(如 ARM64、AMD64)?

指定架构拉取

用轩辕镜像拉镜像时快时慢,常见原因有哪些?

拉取速度原因

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
Bitnami Secure Images(VMware Tanzu)
...
bitnami/mongodb
博客Docker 镜像公告与技术博客
热门查看热门 Docker 镜像推荐
安装一键安装 Docker 并配置镜像源
镜像拉取问题咨询请 提交工单,官方技术交流群:1072982923。轩辕镜像所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
镜像拉取问题咨询请提交工单,官方技术交流群:。轩辕镜像所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
商务合作:点击复制邮箱
©2024-2026 源码跳动
商务合作:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.