[bitnami/mongodb] Release 6.0.12-debian-11-r6 (#54682)

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
Bitnami Bot
2024-01-11 17:14:50 +01:00
committed by GitHub
parent f5013e8ff1
commit 6513af11c8
6 changed files with 97 additions and 24 deletions

View File

@@ -7,10 +7,10 @@ ARG TARGETARCH
LABEL com.vmware.cp.artifact.flavor="sha256:1e1b4657a77f0d47e9220f0c37b9bf7802581b93214fff7d1bd2364c8bf22e8e" \
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \
org.opencontainers.image.created="2023-12-27T15:33:27Z" \
org.opencontainers.image.created="2024-01-11T15:47:47Z" \
org.opencontainers.image.description="Application packaged by VMware, Inc" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.ref.name="6.0.12-debian-11-r5" \
org.opencontainers.image.ref.name="6.0.12-debian-11-r6" \
org.opencontainers.image.title="mongodb" \
org.opencontainers.image.vendor="VMware, Inc." \
org.opencontainers.image.version="6.0.12"
@@ -27,9 +27,9 @@ RUN install_packages ca-certificates curl libbrotli1 libcom-err2 libcurl4 libffi
RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; \
COMPONENTS=( \
"mongodb-shell-2.1.1-0-linux-${OS_ARCH}-debian-11" \
"yq-4.40.5-0-linux-${OS_ARCH}-debian-11" \
"wait-for-port-1.0.7-4-linux-${OS_ARCH}-debian-11" \
"render-template-1.0.6-4-linux-${OS_ARCH}-debian-11" \
"yq-4.40.5-1-linux-${OS_ARCH}-debian-11" \
"wait-for-port-1.0.7-5-linux-${OS_ARCH}-debian-11" \
"render-template-1.0.6-5-linux-${OS_ARCH}-debian-11" \
"mongodb-6.0.12-2-linux-${OS_ARCH}-debian-11" \
) ; \
for COMPONENT in "${COMPONENTS[@]}"; do \

View File

@@ -15,18 +15,18 @@
"arch": "amd64",
"distro": "debian-11",
"type": "NAMI",
"version": "1.0.6-4"
"version": "1.0.6-5"
},
"wait-for-port": {
"arch": "amd64",
"distro": "debian-11",
"type": "NAMI",
"version": "1.0.7-4"
"version": "1.0.7-5"
},
"yq": {
"arch": "amd64",
"distro": "debian-11",
"type": "NAMI",
"version": "4.40.5-0"
"version": "4.40.5-1"
}
}

View File

@@ -10,7 +10,7 @@ fi
script=$1
exit_code="${2:-96}"
fail_if_not_present="${3:-y}"
fail_if_not_present="${3:-n}"
if test -f "$script"; then
sh $script

View File

@@ -383,7 +383,7 @@ mongodb_start_bg() {
fi
# wait until the server is up and answering queries
if ! retry_while "mongodb_is_mongodb_started" "$MONGODB_MAX_TIMEOUT"; then
if ! retry_while "mongodb_is_mongodb_started" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "MongoDB did not start"
exit 1
fi
@@ -423,7 +423,7 @@ mongodb_stop() {
info "Stopping MongoDB..."
stop_service_using_pid "$MONGODB_PID_FILE"
if ! retry_while "is_mongodb_not_running" "$MONGODB_MAX_TIMEOUT"; then
if ! retry_while "is_mongodb_not_running" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "MongoDB failed to stop"
exit 1
fi
@@ -1003,7 +1003,7 @@ mongodb_configure_primary() {
info "Configuring MongoDB primary node"
wait-for-port --timeout 360 "$MONGODB_PORT_NUMBER"
if ! retry_while "mongodb_is_primary_node_initiated $node $port" "$MONGODB_MAX_TIMEOUT"; then
if ! retry_while "mongodb_is_primary_node_initiated $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "MongoDB primary node failed to get configured"
exit 1
fi
@@ -1024,7 +1024,7 @@ mongodb_wait_confirmation() {
local -r port="${2:?port is required}"
debug "Waiting until ${node}:${port} is added to the replica set..."
if ! retry_while "mongodb_node_currently_in_cluster ${node} ${port}" "$MONGODB_MAX_TIMEOUT"; then
if ! retry_while "mongodb_node_currently_in_cluster ${node} ${port}" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "Unable to confirm that ${node}:${port} has been added to the replica set!"
exit 1
else
@@ -1098,14 +1098,14 @@ mongodb_wait_for_node() {
debug "Waiting for primary node..."
info "Trying to connect to MongoDB server $host..."
if ! retry_while "wait-for-port --host $host --timeout 10 $port" "$MONGODB_MAX_TIMEOUT"; then
if ! retry_while "wait-for-port --host $host --timeout 10 $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "Unable to connect to host $host"
exit 1
else
info "Found MongoDB server listening at $host:$port !"
fi
if ! retry_while "mongodb_is_node_available $host $port $user $password" "$MONGODB_MAX_TIMEOUT"; then
if ! retry_while "mongodb_is_node_available $host $port $user $password" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "Node $host did not become available"
exit 1
else
@@ -1130,7 +1130,7 @@ mongodb_wait_for_primary_node() {
mongodb_wait_for_node "$host" "$port" "$user" "$password"
debug "Waiting for primary host $host to be ready..."
if ! retry_while "mongodb_is_primary_node_up $host $port $user $password" "$MONGODB_MAX_TIMEOUT"; then
if ! retry_while "mongodb_is_primary_node_up $host $port $user $password" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "Unable to validate $host as primary node in the replica set scenario!"
exit 1
else
@@ -1158,7 +1158,7 @@ mongodb_configure_secondary() {
info "Node currently in the cluster"
else
info "Adding node to the cluster"
if ! retry_while "mongodb_is_secondary_node_pending $node $port" "$MONGODB_MAX_TIMEOUT"; then
if ! retry_while "mongodb_is_secondary_node_pending $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "Secondary node did not get ready"
exit 1
fi
@@ -1166,14 +1166,14 @@ mongodb_configure_secondary() {
# Ensure that secondary nodes do not count as voting members until they are fully initialized
# https://docs.mongodb.com/manual/reference/method/rs.add/#behavior
if ! retry_while "mongodb_is_secondary_node_ready $node $port" "$MONGODB_MAX_TIMEOUT"; then
if ! retry_while "mongodb_is_secondary_node_ready $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "Secondary node did not get marked as secondary"
exit 1
fi
# Grant voting rights to node
# https://docs.mongodb.com/manual/tutorial/modify-psa-replica-set-safely/
if ! retry_while "mongodb_configure_secondary_node_voting $node $port" "$MONGODB_MAX_TIMEOUT"; then
if ! retry_while "mongodb_configure_secondary_node_voting $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "Secondary node did not get marked as secondary"
exit 1
fi
@@ -1208,7 +1208,7 @@ mongodb_configure_hidden() {
info "Node currently in the cluster"
else
info "Adding hidden node to the cluster"
if ! retry_while "mongodb_is_hidden_node_pending $node $port" "$MONGODB_MAX_TIMEOUT"; then
if ! retry_while "mongodb_is_hidden_node_pending $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "Hidden node did not get ready"
exit 1
fi
@@ -1236,7 +1236,7 @@ mongodb_configure_arbiter() {
info "Node currently in the cluster"
else
info "Configuring MongoDB arbiter node"
if ! retry_while "mongodb_is_arbiter_node_pending $node $port" "$MONGODB_MAX_TIMEOUT"; then
if ! retry_while "mongodb_is_arbiter_node_pending $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "Arbiter node did not get ready"
exit 1
fi
@@ -1277,7 +1277,7 @@ EOF
mongodb_wait_until_sync_complete() {
info "Waiting until initial data sync is complete..."
if ! retry_while "mongodb_is_not_in_sync" "$MONGODB_MAX_TIMEOUT" 1; then
if ! retry_while "mongodb_is_not_in_sync" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY" 1; then
error "Initial data sync did not finish after $MONGODB_MAX_TIMEOUT seconds"
exit 1
else

View File

@@ -25,7 +25,8 @@ export BITNAMI_DEBUG="${BITNAMI_DEBUG:-false}"
# variable will be overridden with the value specified in that file
mongodb_env_vars=(
MONGODB_MOUNTED_CONF_DIR
MONGODB_MAX_TIMEOUT
MONGODB_INIT_RETRY_ATTEMPTS
MONGODB_INIT_RETRY_DELAY
MONGODB_PORT_NUMBER
MONGODB_ENABLE_MAJORITY_READ
MONGODB_DEFAULT_ENABLE_MAJORITY_READ
@@ -106,7 +107,8 @@ export MONGODB_DAEMON_GROUP="mongo"
# MongoDB configuration
export MONGODB_MOUNTED_CONF_DIR="${MONGODB_MOUNTED_CONF_DIR:-${MONGODB_VOLUME_DIR}/conf}"
export MONGODB_MAX_TIMEOUT="${MONGODB_MAX_TIMEOUT:-35}"
export MONGODB_INIT_RETRY_ATTEMPTS="${MONGODB_INIT_RETRY_ATTEMPTS:-7}"
export MONGODB_INIT_RETRY_DELAY="${MONGODB_INIT_RETRY_DELAY:-5}"
export MONGODB_DEFAULT_PORT_NUMBER="27017"
export MONGODB_PORT_NUMBER="${MONGODB_PORT_NUMBER:-$MONGODB_DEFAULT_PORT_NUMBER}"
export MONGODB_ENABLE_MAJORITY_READ="${MONGODB_ENABLE_MAJORITY_READ:-true}"

View File

@@ -169,6 +169,77 @@ docker-compose up -d
## Configuration
### Environment variables
| Name | Description | Default Value | Can be set |
|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|------------|
| `$MONGODB_DISABLE_SERVICE` | Whether to disable the MongoDB service by default. | `no` | &check; |
| `$MONGODB_VOLUME_DIR` | Persistence base directory | `$BITNAMI_VOLUME_DIR/mongodb` | |
| `$MONGODB_BASE_DIR` | MongoDB installation directory | `$BITNAMI_ROOT_DIR/mongodb` | |
| `$MONGODB_CONF_DIR` | MongoDB configuration directory | `$MONGODB_BASE_DIR/conf` | |
| `$MONGODB_LOG_DIR` | MongoDB logs directory | `$MONGODB_BASE_DIR/logs` | |
| `$MONGODB_DATA_DIR` | MongoDB data directory | `${MONGODB_VOLUME_DIR}/data` | |
| `$MONGODB_TMP_DIR` | MongoDB temporary directory | `$MONGODB_BASE_DIR/tmp` | |
| `$MONGODB_BIN_DIR` | MongoDB executables directory | `$MONGODB_BASE_DIR/bin` | |
| `$MONGODB_TEMPLATES_DIR` | Directory where the mongodb.conf template file is stored | `$MONGODB_BASE_DIR/templates` | |
| `$MONGODB_MONGOD_TEMPLATES_FILE` | Path to the mongodb.conf template file | `$MONGODB_TEMPLATES_DIR/mongodb.conf.tpl` | |
| `$MONGODB_CONF_FILE` | Path to MongoDB configuration file | `$MONGODB_CONF_DIR/mongodb.conf` | |
| `$MONGODB_KEY_FILE` | Path to the MongoDB replica set keyfile | `$MONGODB_CONF_DIR/keyfile` | |
| `$MONGODB_DB_SHELL_FILE` | Path to MongoDB dbshell file | `/.dbshell` | |
| `$MONGODB_RC_FILE` | Path to MongoDB rc file | `/.mongorc.js` | |
| `$MONGOSH_DIR` | Path to mongosh directory | `/.mongodb` | |
| `$MONGOSH_RC_FILE` | Path to mongosh rc file | `/.mongoshrc.js` | |
| `$MONGODB_PID_FILE` | Path to the MongoDB PID file | `$MONGODB_TMP_DIR/mongodb.pid` | |
| `$MONGODB_LOG_FILE` | Path to the MongoDB log file | `$MONGODB_LOG_DIR/mongodb.log` | |
| `$MONGODB_INITSCRIPTS_DIR` | Path to the MongoDB container init scripts directory | `/docker-entrypoint-initdb.d` | |
| `$MONGODB_DAEMON_USER` | MongoDB system user | `mongo` | |
| `$MONGODB_DAEMON_GROUP` | MongoDB system group | `mongo` | |
| `$MONGODB_MOUNTED_CONF_DIR` | Directory for including custom configuration files (that override the default generated ones) | `${MONGODB_VOLUME_DIR}/conf` | &check; |
| `$MONGODB_INIT_RETRY_ATTEMPTS` | Maximum retries for checking the service initialization status | `7` | &check; |
| `$MONGODB_INIT_RETRY_DELAY` | Time (in seconds) to wait between retries for checking the service initialization status | `5` | &check; |
| `$MONGODB_DEFAULT_PORT_NUMBER` | MongoDB port set at build time | `27017` | |
| `$MONGODB_PORT_NUMBER` | MongoDB port | `$MONGODB_DEFAULT_PORT_NUMBER` | &check; |
| `$MONGODB_ENABLE_MAJORITY_READ` | Enable majority read in MongoDB operations | `true` | &check; |
| `$MONGODB_DEFAULT_ENABLE_MAJORITY_READ` | Enable majority read in MongoDB operations set at build time | `true` | &check; |
| `$MONGODB_EXTRA_FLAGS` | Extra flags for MongoDB initialization | | &check; |
| `$MONGODB_ENABLE_NUMACTL` | Execute commands using numactl | `false` | &check; |
| `$MONGODB_SHELL_EXTRA_FLAGS` | Extra flags when using the mongodb client during initialization (useful when mounting init scripts) | | &check; |
| `$MONGODB_ADVERTISED_HOSTNAME` | Hostname to use for advertising the MongoDB service | | &check; |
| `$MONGODB_ADVERTISE_IP` | Whether advertised hostname is set to container ip | `false` | &check; |
| `$MONGODB_ADVERTISED_PORT_NUMBER` | MongoDB advertised port number. It is recommended to pass this environment variable if you have a proxy port forwarding requests to container. | | &check; |
| `$MONGODB_DISABLE_JAVASCRIPT` | Disable MongoDB server-side javascript execution | `no` | &check; |
| `$MONGODB_ENABLE_JOURNAL` | Enable MongoDB journal | | &check; |
| `$MONGODB_DEFAULT_ENABLE_JOURNAL` | Enable MongoDB journal at build time | `true` | |
| `$MONGODB_DISABLE_SYSTEM_LOG` | Disable MongoDB daemon system log | | &check; |
| `$MONGODB_DEFAULT_DISABLE_SYSTEM_LOG` | Disable MongoDB daemon system log set at build time | `false` | |
| `$MONGODB_ENABLE_DIRECTORY_PER_DB` | Use a separate folder for storing each database data | | &check; |
| `$MONGODB_DEFAULT_ENABLE_DIRECTORY_PER_DB` | Use a separate folder for storing each database data set at build time | `false` | |
| `$MONGODB_ENABLE_IPV6` | Use IPv6 for database connections | | &check; |
| `$MONGODB_DEFAULT_ENABLE_IPV6` | Use IPv6 for database connections set at build time | `false` | |
| `$MONGODB_SYSTEM_LOG_VERBOSITY` | MongoDB daemon log level | | &check; |
| `$MONGODB_DEFAULT_SYSTEM_LOG_VERBOSITY` | MongoDB daemon log level set at build time | `0` | |
| `$MONGODB_ROOT_USER` | User name for the MongoDB root user | `root` | &check; |
| `$MONGODB_ROOT_PASSWORD` | Password for the MongoDB root user | | &check; |
| `$MONGODB_USERNAME` | User to generate at initialization time | | &check; |
| `$MONGODB_PASSWORD` | Password for the non-root user specified in MONGODB_USERNAME | | &check; |
| `$MONGODB_DATABASE` | Name of the database to create at initialization time | | &check; |
| `$MONGODB_METRICS_USERNAME` | User used for metrics collection, for example with mongodb_exporter | | &check; |
| `$MONGODB_METRICS_PASSWORD` | Password for the non-root user specified in MONGODB_METRICS_USERNAME | | &check; |
| `$MONGODB_EXTRA_USERNAMES` | Comma or semicolon separated list of extra users to be created. | | &check; |
| `$MONGODB_EXTRA_PASSWORDS` | Comma or semicolon separated list of passwords for the users specified in MONGODB_EXTRA_USERNAMES. | | &check; |
| `$MONGODB_EXTRA_DATABASES` | Comma or semicolon separated list of databases to create at initialization time for the users specified in MONGODB_EXTRA_USERNAMES. | | &check; |
| `$ALLOW_EMPTY_PASSWORD` | Permit accessing MongoDB without setting any password | `no` | &check; |
| `$MONGODB_REPLICA_SET_MODE` | MongoDB replica set mode. Can be one of primary, secondary or arbiter | | &check; |
| `$MONGODB_DEFAULT_REPLICA_SET_NAME` | Name of the MongoDB replica set at build time | `replicaset` | |
| `$MONGODB_REPLICA_SET_NAME` | Name of the MongoDB replica set | `$MONGODB_DEFAULT_REPLICA_SET_NAME` | &check; |
| `$MONGODB_REPLICA_SET_KEY` | MongoDB replica set key | | &check; |
| `$MONGODB_INITIAL_PRIMARY_HOST` | Hostname of the replica set primary node (necessary for arbiter and secondary nodes) | | &check; |
| `$MONGODB_INITIAL_PRIMARY_PORT_NUMBER` | Port of the replica set primary node (necessary for arbiter and secondary nodes) | `27017` | &check; |
| `$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD` | Primary node root user password (necessary for arbiter and secondary nodes) | | &check; |
| `$MONGODB_INITIAL_PRIMARY_ROOT_USER` | Primary node root username (necessary for arbiter and secondary nodes) | `root` | &check; |
| `$MONGODB_SET_SECONDARY_OK` | Mark node as readable. Necessary for cases where the PVC is lost | `no` | &check; |
### 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`.