11# Copyright Broadcom, Inc. All Rights Reserved.
22# SPDX-License-Identifier: APACHE-2.0
33
4- FROM docker.io/bitnami/minideb:bookworm
4+ FROM docker.io/bitnami/minideb:bookworm@sha256:5b4e544f5d0c4669d3dbe4f4de8d3ca221d430e6a1cf3ac60007387abbbd5363
55
66ARG DOWNLOADS_URL="downloads.bitnami.com/files/stacksmith"
77ARG TARGETARCH
8+ ARG MONGODB_VERSION
9+ ARG MONGODB_DATABASE_TOOLS_VERSION="100.13.0"
10+ ARG MONGODB_DATABASE_TOOLS_AMD64_SHA256="1c77ab3d8b177410af6e313164e459243bca70794e76c5ca1ad3fa324ae16f14"
11+ ARG MONGODB_DATABASE_TOOLS_ARM64_SHA256="bd404104d7239cc5e88d5ed326870bd851b2012eef92797bfad5c9aa254a364e"
812
913LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
1014 org.opencontainers.image.created="2025-09-07T01:52:10Z" \
@@ -13,7 +17,7 @@ LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
1317 org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/mongodb-sharded" \
1418 org.opencontainers.image.title="mongodb-sharded" \
1519 org.opencontainers.image.vendor="Broadcom, Inc." \
16- org.opencontainers.image.version="8.0.13 "
20+ org.opencontainers.image.version="${MONGODB_VERSION} "
1721
1822ENV HOME="/" \
1923 OS_ARCH="${TARGETARCH:-amd64}" \
@@ -23,7 +27,7 @@ ENV HOME="/" \
2327COPY prebuildfs /
2428SHELL ["/bin/bash" , "-o" , "errexit" , "-o" , "nounset" , "-o" , "pipefail" , "-c" ]
2529# Install required system packages and dependencies
26- RUN install_packages ca-certificates curl libbrotli1 libcom-err2 libcurl4 libffi8 libgcc-s1 libgmp10 libgnutls30 libgssapi-krb5-2 libhogweed6 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.5-0 libnettle8 libnghttp2-14 libp11-kit0 libpsl5 librtmp1 libsasl2-2 libssh2-1 libssl3 libtasn1-6 libunistring2 libzstd1 numactl procps zlib1g
30+ RUN /bin/bash /usr/sbin/ install_packages ca-certificates curl libbrotli1 libcom-err2 libcurl4 libffi8 libgcc-s1 libgmp10 libgnutls30 libgssapi-krb5-2 libhogweed6 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.5-0 libnettle8 libnghttp2-14 libp11-kit0 libpsl5 librtmp1 libsasl2-2 libssh2-1 libssl3 libtasn1-6 libunistring2 libzstd1 numactl procps zlib1g
2731RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \
2832 DOWNLOADS_URL=${SECRET_DOWNLOADS_URL:-${DOWNLOADS_URL}} ; \
2933 mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ || exit 1 ; \
@@ -32,7 +36,6 @@ RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \
3236 "wait-for-port-1.0.10-1-linux-${OS_ARCH}-debian-12" \
3337 "render-template-1.0.9-156-linux-${OS_ARCH}-debian-12" \
3438 "mongodb-shell-2.5.7-0-linux-${OS_ARCH}-debian-12" \
35- "mongodb-8.0.13-0-linux-${OS_ARCH}-debian-12" \
3639 ) ; \
3740 for COMPONENT in "${COMPONENTS[@]}" ; do \
3841 if [ ! -f "${COMPONENT}.tar.gz" ]; then \
@@ -42,7 +45,29 @@ RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \
4245 sha256sum -c "${COMPONENT}.tar.gz.sha256" ; \
4346 tar -zxf "${COMPONENT}.tar.gz" -C /opt/bitnami --strip-components=2 --no-same-owner ; \
4447 rm -rf "${COMPONENT}" .tar.gz{,.sha256} ; \
45- done
48+ done ; \
49+ # Download official MongoDB server binary from MongoDB Inc
50+ # Use debian12 build for amd64 (matches our minideb:bookworm base);
51+ # arm64 debian12 tarballs are not published, so use ubuntu2204 for arm64.
52+ if [ "${OS_ARCH}" = "arm64" ]; then \
53+ MONGODB_TARBALL="mongodb-linux-aarch64-ubuntu2204-${MONGODB_VERSION}.tgz" ; \
54+ MONGODB_DATABASE_TOOLS_TARBALL="mongodb-database-tools-ubuntu2204-arm64-${MONGODB_DATABASE_TOOLS_VERSION}.tgz" ; \
55+ MONGODB_DATABASE_TOOLS_SHA256="${MONGODB_DATABASE_TOOLS_ARM64_SHA256}" ; \
56+ else \
57+ MONGODB_TARBALL="mongodb-linux-x86_64-debian12-${MONGODB_VERSION}.tgz" ; \
58+ MONGODB_DATABASE_TOOLS_TARBALL="mongodb-database-tools-debian12-x86_64-${MONGODB_DATABASE_TOOLS_VERSION}.tgz" ; \
59+ MONGODB_DATABASE_TOOLS_SHA256="${MONGODB_DATABASE_TOOLS_AMD64_SHA256}" ; \
60+ fi ; \
61+ curl -SsLf "https://fastdl.mongodb.org/linux/${MONGODB_TARBALL}" -O ; \
62+ curl -SsLf "https://fastdl.mongodb.org/linux/${MONGODB_TARBALL}.sha256" -O ; \
63+ sha256sum -c "${MONGODB_TARBALL}.sha256" ; \
64+ mkdir -p /opt/bitnami/mongodb ; \
65+ tar -zxf "${MONGODB_TARBALL}" -C /opt/bitnami/mongodb --strip-components=1 --no-same-owner ; \
66+ rm -rf "${MONGODB_TARBALL}" {,.sha256} ; \
67+ curl -SsLf "https://fastdl.mongodb.org/tools/db/${MONGODB_DATABASE_TOOLS_TARBALL}" -O ; \
68+ echo "${MONGODB_DATABASE_TOOLS_SHA256} ${MONGODB_DATABASE_TOOLS_TARBALL}" | sha256sum -c - ; \
69+ tar -zxf "${MONGODB_DATABASE_TOOLS_TARBALL}" -C /opt/bitnami/mongodb --strip-components=1 --no-same-owner ; \
70+ rm -rf "${MONGODB_DATABASE_TOOLS_TARBALL}"
4671RUN apt-get update && apt-get upgrade -y && \
4772 apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives
4873RUN chmod g+rwX /opt/bitnami
@@ -52,8 +77,9 @@ RUN ln -s /opt/bitnami/scripts/liblog.sh /liblog.sh
5277RUN ln -s /opt/bitnami/scripts/mongodb-sharded/run.sh /run.sh
5378
5479COPY rootfs /
55- RUN /opt/bitnami/scripts/mongodb-sharded/postunpack.sh
56- ENV APP_VERSION="8.0.13" \
80+ RUN find /opt/bitnami/scripts -name "*.sh" -exec chmod a+x {} +
81+ RUN /bin/bash /opt/bitnami/scripts/mongodb-sharded/postunpack.sh
82+ ENV APP_VERSION="${MONGODB_VERSION}" \
5783 BITNAMI_APP_NAME="mongodb-sharded" \
5884 IMAGE_REVISION="1" \
5985 PATH="/opt/bitnami/common/bin:/opt/bitnami/mongodb/bin:$PATH"
0 commit comments