From 0b51bcf4f7c2b1f90df83df2f8a9f6e7731dc383 Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Thu, 21 Apr 2022 16:18:26 +0000 Subject: [PATCH] 4.2.19-debian-10-r48 release --- bitnami/mongodb/4.2/debian-10/Dockerfile | 3 +- .../opt/bitnami/.bitnami_components.json | 9 +++++- .../rootfs/opt/bitnami/scripts/libmongodb.sh | 32 +++++++++---------- .../rootfs/opt/bitnami/scripts/mongodb-env.sh | 2 ++ .../opt/bitnami/scripts/mongodb/postunpack.sh | 5 +++ bitnami/mongodb/README.md | 2 +- 6 files changed, 34 insertions(+), 19 deletions(-) diff --git a/bitnami/mongodb/4.2/debian-10/Dockerfile b/bitnami/mongodb/4.2/debian-10/Dockerfile index f1c2591097d2..9b0bc3e64576 100644 --- a/bitnami/mongodb/4.2/debian-10/Dockerfile +++ b/bitnami/mongodb/4.2/debian-10/Dockerfile @@ -9,10 +9,11 @@ ENV HOME="/" \ COPY prebuildfs / # Install required system packages and dependencies RUN install_packages acl ca-certificates curl gzip libc6 libcom-err2 libcurl4 libffi6 libgcc1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libgssapi-krb5-2 libhogweed4 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 libnettle6 libnghttp2-14 libp11-kit0 libpcap0.8 libpsl5 librtmp1 libsasl2-2 libssh2-1 libssl1.1 libtasn1-6 libunistring2 numactl procps tar zlib1g +RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "mongodb-shell" "1.3.1-0" --checksum 13407d9f6a5ae6b0895faf702da3e919c03354349506b2bcf19da0a3545e7f8c RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "yq" "4.24.5-0" --checksum bdae511963f6a46ad128f41f9a6f2eec8c56fbb4929619fcd54232edfec6209e RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "wait-for-port" "1.0.1-10" --checksum 35c818ba3f4b5aae905959bc7d3a5e81fc63786e3c662b604612c0aa7fcda8fd RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "render-template" "1.0.1-10" --checksum 97c2ae4b001c5937e888b920bee7b1a40a076680caac53ded6d10f6207d54565 -RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "mongodb" "4.2.19-1" --checksum 3d763e80a87697b1c5a4231f2465e8dc1450b8f735379789ae4d1061792be811 +RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "mongodb" "4.2.19-2" --checksum 3d763e80a87697b1c5a4231f2465e8dc1450b8f735379789ae4d1061792be811 RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "gosu" "1.14.0-7" --checksum d6280b6f647a62bf6edc74dc8e526bfff63ddd8067dcb8540843f47203d9ccf1 RUN apt-get update && apt-get upgrade -y && \ rm -r /var/lib/apt/lists /var/cache/apt/archives diff --git a/bitnami/mongodb/4.2/debian-10/prebuildfs/opt/bitnami/.bitnami_components.json b/bitnami/mongodb/4.2/debian-10/prebuildfs/opt/bitnami/.bitnami_components.json index 5d884f3ed00d..e2e6c0898514 100644 --- a/bitnami/mongodb/4.2/debian-10/prebuildfs/opt/bitnami/.bitnami_components.json +++ b/bitnami/mongodb/4.2/debian-10/prebuildfs/opt/bitnami/.bitnami_components.json @@ -11,7 +11,14 @@ "digest": "3d763e80a87697b1c5a4231f2465e8dc1450b8f735379789ae4d1061792be811", "distro": "debian-10", "type": "NAMI", - "version": "4.2.19-1" + "version": "4.2.19-2" + }, + "mongodb-shell": { + "arch": "amd64", + "digest": "13407d9f6a5ae6b0895faf702da3e919c03354349506b2bcf19da0a3545e7f8c", + "distro": "debian-10", + "type": "NAMI", + "version": "1.3.1-0" }, "render-template": { "arch": "amd64", diff --git a/bitnami/mongodb/4.2/debian-10/rootfs/opt/bitnami/scripts/libmongodb.sh b/bitnami/mongodb/4.2/debian-10/rootfs/opt/bitnami/scripts/libmongodb.sh index 4c09c06ea677..32468500628e 100644 --- a/bitnami/mongodb/4.2/debian-10/rootfs/opt/bitnami/scripts/libmongodb.sh +++ b/bitnami/mongodb/4.2/debian-10/rootfs/opt/bitnami/scripts/libmongodb.sh @@ -783,12 +783,12 @@ EOF # Code 23 is considered OK # It indicates that the node is already initialized - if grep -q "\"code\" : 23" <<<"$result"; then + if grep -q "already initialized" <<<"$result"; then warn "Node already initialized." return 0 fi - if ! grep -q "\"ok\" : 1" <<<"$result"; then + if ! grep -q "ok: 1" <<<"$result"; then warn "Problem initiating replica set request: rs.initiate({\"_id\":\"$MONGODB_REPLICA_SET_NAME\", \"members\":[{\"_id\":0,\"host\":\"$node:$port\",\"priority\":5}]}) response: $result" @@ -812,7 +812,7 @@ mongodb_set_dwc() { db.adminCommand({"setDefaultRWConcern" : 1, "defaultWriteConcern" : {"w" : "majority"}}) EOF ) - if grep -q "\"ok\" : 1" <<<"$result"; then + if grep -q "ok: 1" <<<"$result"; then debug 'Setting Default Write Concern to {"setDefaultRWConcern" : 1, "defaultWriteConcern" : {"w" : "majority"}}' return 0 else @@ -848,11 +848,11 @@ EOF # Error code 103 is considered OK # It indicates a possibly desynced configuration, which will become resynced when the secondary joins the replicaset # Note: Error NewReplicaSetConfigurationIncompatible rejects the node addition so we need to filter it out - if { grep -q "\"code\" : 103" <<<"$result"; } && ! { grep -q "NewReplicaSetConfigurationIncompatible" <<<"$result"; }; then + if { grep -q "code: 103" <<<"$result"; } && ! { grep -q "NewReplicaSetConfigurationIncompatible" <<<"$result"; }; then warn "The ReplicaSet configuration is not aligned with primary node's configuration. Starting secondary node so it syncs with ReplicaSet..." return 0 fi - grep -q "\"ok\" : 1" <<<"$result" + grep -q "ok: 1" <<<"$result" } ######################## @@ -908,7 +908,7 @@ EOF ) debug "$result" - grep -q "\"ok\" : 1" <<<"$result" + grep -q "ok: 1" <<<"$result" } ######################## @@ -937,11 +937,11 @@ EOF # Error code 103 is considered OK. # It indicates a possiblely desynced configuration, # which will become resynced when the hidden joins the replicaset. - if grep -q "\"code\" : 103" <<<"$result"; then + if grep -q "code: 103" <<<"$result"; then warn "The ReplicaSet configuration is not aligned with primary node's configuration. Starting hidden node so it syncs with ReplicaSet..." return 0 fi - grep -q "\"ok\" : 1" <<<"$result" + grep -q "ok: 1" <<<"$result" } ######################## @@ -967,7 +967,7 @@ mongodb_is_arbiter_node_pending() { rs.addArb('$node:$port') EOF ) - grep -q "\"ok\" : 1" <<<"$result" + grep -q "ok: 1" <<<"$result" } ######################## @@ -1060,7 +1060,7 @@ mongodb_is_node_available() { db.getUsers() EOF ) - if ! grep -q "\"user\" :" <<<"$result"; then + if ! grep -q "user:" <<<"$result"; then # If no password was provided on first run # it may be the case that DB is up but has no users [[ -z $password ]] && grep -q "\[\ \]" <<<"$result" @@ -1242,11 +1242,11 @@ mongodb_is_not_in_sync() { result=$( mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" "$MONGODB_INITIAL_PRIMARY_HOST" "$MONGODB_INITIAL_PRIMARY_PORT_NUMBER" </dev/null | grep 'shell version v' | sed 's/.* v//g' + mongod --version 2>/dev/null | awk -F\" '/"version"/ {print $4}' } ######################## @@ -1582,7 +1582,7 @@ mongodb_execute_print_output() { fi [[ -n "$database" ]] && args+=("$database") - "$MONGODB_BIN_DIR/mongo" "${args[@]}" + "$MONGODB_BIN_DIR/mongosh" "${args[@]}" } ######################## @@ -1641,5 +1641,5 @@ mongodb_execute() { fi [[ -n "$database" ]] && args+=("$database") - "$MONGODB_BIN_DIR/mongo" "${args[@]}" + "$MONGODB_BIN_DIR/mongosh" "${args[@]}" } diff --git a/bitnami/mongodb/4.2/debian-10/rootfs/opt/bitnami/scripts/mongodb-env.sh b/bitnami/mongodb/4.2/debian-10/rootfs/opt/bitnami/scripts/mongodb-env.sh index 1fa058ffdeb1..daf18e1f0035 100644 --- a/bitnami/mongodb/4.2/debian-10/rootfs/opt/bitnami/scripts/mongodb-env.sh +++ b/bitnami/mongodb/4.2/debian-10/rootfs/opt/bitnami/scripts/mongodb-env.sh @@ -90,6 +90,8 @@ export MONGODB_CONF_FILE="$MONGODB_CONF_DIR/mongodb.conf" export MONGODB_KEY_FILE="$MONGODB_CONF_DIR/keyfile" export MONGODB_DB_SHELL_FILE="/.dbshell" export MONGODB_RC_FILE="/.mongorc.js" +export MONGOSH_DIR="/.mongodb" +export MONGOSH_RC_FILE="/.mongoshrc.js" export MONGODB_PID_FILE="$MONGODB_TMP_DIR/mongodb.pid" export MONGODB_LOG_FILE="$MONGODB_LOG_DIR/mongodb.log" export MONGODB_INITSCRIPTS_DIR="/docker-entrypoint-initdb.d" diff --git a/bitnami/mongodb/4.2/debian-10/rootfs/opt/bitnami/scripts/mongodb/postunpack.sh b/bitnami/mongodb/4.2/debian-10/rootfs/opt/bitnami/scripts/mongodb/postunpack.sh index 9adcba9f529a..92921833b520 100755 --- a/bitnami/mongodb/4.2/debian-10/rootfs/opt/bitnami/scripts/mongodb/postunpack.sh +++ b/bitnami/mongodb/4.2/debian-10/rootfs/opt/bitnami/scripts/mongodb/postunpack.sh @@ -26,6 +26,11 @@ render-template "$MONGODB_MONGOD_TEMPLATES_FILE" >"$MONGODB_CONF_FILE" touch "$MONGODB_DB_SHELL_FILE" && chmod g+rw "$MONGODB_DB_SHELL_FILE" # Create .mongorc.js file to avoid error message touch "$MONGODB_RC_FILE" && chmod g+rw "$MONGODB_RC_FILE" +# Create .mongoshrc.js file to avoid error message +touch "$MONGOSH_RC_FILE" && chmod g+rw "$MONGOSH_RC_FILE" +# Create .mongodb folder to avoid error message +mkdir "$MONGOSH_DIR" && chmod g+rwX "$MONGOSH_DIR" + chmod 660 "$MONGODB_CONF_FILE" # Redirect all logging to stdout diff --git a/bitnami/mongodb/README.md b/bitnami/mongodb/README.md index fc717221c3ce..bf6b33ad7db3 100644 --- a/bitnami/mongodb/README.md +++ b/bitnami/mongodb/README.md @@ -47,7 +47,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t * [`5.0`, `5.0-debian-10`, `5.0.7`, `5.0.7-debian-10-r6`, `latest` (5.0/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/5.0.7-debian-10-r6/5.0/debian-10/Dockerfile) * [`4.4`, `4.4-debian-10`, `4.4.13`, `4.4.13-debian-10-r49` (4.4/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.4.13-debian-10-r49/4.4/debian-10/Dockerfile) -* [`4.2`, `4.2-debian-10`, `4.2.19`, `4.2.19-debian-10-r47` (4.2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.2.19-debian-10-r47/4.2/debian-10/Dockerfile) +* [`4.2`, `4.2-debian-10`, `4.2.19`, `4.2.19-debian-10-r48` (4.2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.2.19-debian-10-r48/4.2/debian-10/Dockerfile) Subscribe to project updates by watching the [bitnami/mongodb GitHub repo](https://github.com/bitnami/bitnami-docker-mongodb).