Skip to content

Commit ca015c0

Browse files
authored
Merge pull request #120 from circleci/ONPREM-2472/add-mongo-7.0
[ONPREM-2472] - Add Mongodb image
2 parents 22ffb28 + 34e5307 commit ca015c0

28 files changed

+5146
-0
lines changed

.circleci/config.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ jobs:
7575
DOCKERFILE_PATH: Dockerfile
7676
MAJOR_VERSION: 6.2
7777
pwd: redis/6.2/debian-10
78+
scan_mongodb:
79+
executor: ccc
80+
steps:
81+
- set_up_container
82+
- run:
83+
name: Scan server-mongodb image
84+
command: scan
85+
environment:
86+
NAME: server-mongodb
87+
DOCKERFILE_PATH: Dockerfile
88+
MAJOR_VERSION: 7.0
89+
pwd: mongodb/7.0/debian-12
7890
publish_postgresql:
7991
executor: ccc
8092
steps:
@@ -114,6 +126,19 @@ jobs:
114126
DOCKER_REGISTRY: dockerhub
115127
MAJOR_VERSION: 6.2
116128
pwd: redis/6.2/debian-10
129+
publish_mongodb:
130+
executor: ccc
131+
steps:
132+
- set_up_container
133+
- run:
134+
name: Build and publish server-mongodb image
135+
command: publish
136+
environment:
137+
NAME: server-mongodb
138+
DOCKERFILE_PATH: Dockerfile
139+
DOCKER_REGISTRY: dockerhub
140+
MAJOR_VERSION: 7.0
141+
pwd: mongodb/7.0/debian-12
117142

118143
# Charts
119144
validate-charts:
@@ -204,6 +229,13 @@ workflows:
204229
ignore:
205230
- main
206231
- /^server-\d\..+/
232+
- scan_mongodb:
233+
context: "org-global"
234+
filters:
235+
branches:
236+
ignore:
237+
- main
238+
- /^server-\d\..+/
207239
- publish_rabbitmq:
208240
context: "org-global"
209241
filters:
@@ -225,13 +257,21 @@ workflows:
225257
only:
226258
- main
227259
- /^server-\d\..+/
260+
- publish_mongodb:
261+
context: "org-global"
262+
filters:
263+
branches:
264+
only:
265+
- main
266+
- /^server-\d\..+/
228267
- scotty-orb/test-in-server-and-promote:
229268
name: test-in-server-and-promote
230269
context: ["org-global", github-readonly]
231270
requires:
232271
- publish_rabbitmq
233272
- publish_postgresql
234273
- publish_redis
274+
- publish_mongodb
235275
- validate-charts
236276
promotion_component_list: "circleci/server-postgres circleci/server-rabbitmq circleci/server-redis"
237277
filters:

mongodb/7.0/debian-12/Dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Copyright VMware, Inc.
2+
# SPDX-License-Identifier: APACHE-2.0
3+
# Modifications copyright (C) 2025 Circle Internet Services, Inc.
4+
5+
FROM docker.io/bitnami/minideb:bookworm
6+
7+
ENV HOME="/" \
8+
OS_ARCH="amd64" \
9+
OS_FLAVOUR="debian-12" \
10+
OS_NAME="linux"
11+
12+
COPY prebuildfs /
13+
SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"]
14+
15+
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 wget gnupg2
16+
RUN mkdir -p /opt/bitnami/common/bin /tmp/downloads && cd /tmp/downloads && \
17+
curl -L -o yq https://github.com/mikefarah/yq/releases/download/v4.44.6/yq_linux_amd64 && \
18+
chmod +x yq && mv yq /opt/bitnami/common/bin/ && \
19+
\
20+
curl -L -o wait-for-port.tar.gz https://github.com/bitnami/wait-for-port/releases/download/v1.0.8/wait-for-port-linux-amd64.tar.gz && \
21+
tar -xzf wait-for-port.tar.gz && \
22+
find . -name "*wait*" -type f -executable -exec cp {} /opt/bitnami/common/bin/wait-for-port \; && \
23+
chmod +x /opt/bitnami/common/bin/wait-for-port && \
24+
\
25+
curl -L -o render-template.tar.gz https://github.com/bitnami/render-template/releases/download/v1.0.7/render-template-linux-amd64.tar.gz && \
26+
tar -xzf render-template.tar.gz && \
27+
find . -name "*render*" -type f -executable -exec cp {} /opt/bitnami/common/bin/render-template \; && \
28+
chmod +x /opt/bitnami/common/bin/render-template && \
29+
\
30+
curl -L -o mongosh.tgz https://downloads.mongodb.com/compass/mongosh-2.3.4-linux-x64.tgz && \
31+
tar -xzf mongosh.tgz && \
32+
cp mongosh-*/bin/* /opt/bitnami/common/bin/ && \
33+
\
34+
curl -L -o mongodb.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian12-7.0.15.tgz && \
35+
tar -xzf mongodb.tgz && \
36+
cp mongodb-linux-*/bin/* /opt/bitnami/common/bin/ && \
37+
\
38+
cd / && rm -rf /tmp/downloads
39+
40+
RUN apt-get autoremove --purge -y curl && \
41+
apt-get update && apt-get upgrade -y && \
42+
apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives
43+
RUN chmod g+rwX /opt/bitnami
44+
RUN find / -perm /6000 -type f -exec chmod a-s {} \; || true
45+
46+
COPY rootfs /
47+
RUN /opt/bitnami/scripts/mongodb/postunpack.sh
48+
ENV APP_VERSION="7.0.15" \
49+
BITNAMI_APP_NAME="mongodb" \
50+
PATH="/opt/bitnami/common/bin:/opt/bitnami/mongodb/bin:$PATH"
51+
52+
EXPOSE 27017
53+
54+
USER 1001
55+
ENTRYPOINT [ "/opt/bitnami/scripts/mongodb/entrypoint.sh" ]
56+
CMD [ "/opt/bitnami/scripts/mongodb/run.sh" ]
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright VMware, Inc.
2+
# SPDX-License-Identifier: APACHE-2.0
3+
# Modifications copyright (C) 2025 Circle Internet Services, Inc.
4+
5+
services:
6+
mongodb-primary:
7+
image: docker.io/bitnami/mongodb:7.0
8+
environment:
9+
- MONGODB_ADVERTISED_HOSTNAME=mongodb-primary
10+
- MONGODB_REPLICA_SET_MODE=primary
11+
- MONGODB_ROOT_PASSWORD=password123
12+
- MONGODB_REPLICA_SET_KEY=replicasetkey123
13+
volumes:
14+
- 'mongodb_master_data:/bitnami/mongodb'
15+
16+
mongodb-secondary:
17+
image: docker.io/bitnami/mongodb:7.0
18+
depends_on:
19+
- mongodb-primary
20+
environment:
21+
- MONGODB_ADVERTISED_HOSTNAME=mongodb-secondary
22+
- MONGODB_REPLICA_SET_MODE=secondary
23+
- MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary
24+
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password123
25+
- MONGODB_REPLICA_SET_KEY=replicasetkey123
26+
27+
mongodb-arbiter:
28+
image: docker.io/bitnami/mongodb:7.0
29+
depends_on:
30+
- mongodb-primary
31+
environment:
32+
- MONGODB_ADVERTISED_HOSTNAME=mongodb-arbiter
33+
- MONGODB_REPLICA_SET_MODE=arbiter
34+
- MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary
35+
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password123
36+
- MONGODB_REPLICA_SET_KEY=replicasetkey123
37+
38+
volumes:
39+
mongodb_master_data:
40+
driver: local
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright VMware, Inc.
2+
# SPDX-License-Identifier: APACHE-2.0
3+
# Modifications copyright (C) 2025 Circle Internet Services, Inc.
4+
5+
services:
6+
mongodb:
7+
image: docker.io/bitnami/mongodb:7.0
8+
ports:
9+
- "27017:27017"
10+
volumes:
11+
- 'mongodb_data:/bitnami/mongodb'
12+
13+
volumes:
14+
mongodb_data:
15+
driver: local
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"mongodb": {
3+
"arch": "amd64",
4+
"distro": "debian-12",
5+
"type": "NAMI",
6+
"version": "7.0.15-0"
7+
},
8+
"mongodb-shell": {
9+
"arch": "amd64",
10+
"distro": "debian-12",
11+
"type": "NAMI",
12+
"version": "2.3.4-0"
13+
},
14+
"render-template": {
15+
"arch": "amd64",
16+
"distro": "debian-12",
17+
"type": "NAMI",
18+
"version": "1.0.7-8"
19+
},
20+
"wait-for-port": {
21+
"arch": "amd64",
22+
"distro": "debian-12",
23+
"type": "NAMI",
24+
"version": "1.0.8-8"
25+
},
26+
"yq": {
27+
"arch": "amd64",
28+
"distro": "debian-12",
29+
"type": "NAMI",
30+
"version": "4.44.6-0"
31+
}
32+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Bitnami containers ship with software bundles. You can find the licenses under:
2+
/opt/bitnami/[name-of-bundle]/licenses/[bundle-version].txt
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
# Copyright Broadcom, Inc. All Rights Reserved.
3+
# SPDX-License-Identifier: APACHE-2.0
4+
#
5+
# Bitnami custom library
6+
7+
# shellcheck disable=SC1091
8+
9+
# Load Generic Libraries
10+
. /opt/bitnami/scripts/liblog.sh
11+
12+
# Constants
13+
BOLD='\033[1m'
14+
15+
# Functions
16+
17+
########################
18+
# Print the welcome page
19+
# Globals:
20+
# DISABLE_WELCOME_MESSAGE
21+
# BITNAMI_APP_NAME
22+
# Arguments:
23+
# None
24+
# Returns:
25+
# None
26+
#########################
27+
print_welcome_page() {
28+
if [[ -z "${DISABLE_WELCOME_MESSAGE:-}" ]]; then
29+
if [[ -n "$BITNAMI_APP_NAME" ]]; then
30+
print_image_welcome_page
31+
fi
32+
fi
33+
}
34+
35+
########################
36+
# Print the welcome page for a Bitnami Docker image
37+
# Globals:
38+
# BITNAMI_APP_NAME
39+
# Arguments:
40+
# None
41+
# Returns:
42+
# None
43+
#########################
44+
print_image_welcome_page() {
45+
local github_url="https://github.com/bitnami/containers"
46+
47+
info ""
48+
info "${BOLD}Welcome to the Bitnami ${BITNAMI_APP_NAME} container${RESET}"
49+
info "Subscribe to project updates by watching ${BOLD}${github_url}${RESET}"
50+
info "Submit issues and feature requests at ${BOLD}${github_url}/issues${RESET}"
51+
info "Upgrade to Tanzu Application Catalog for production environments to access custom-configured and pre-packaged software components. Gain enhanced features, including Software Bill of Materials (SBOM), CVE scan result reports, and VEX documents. To learn more, visit ${BOLD}https://bitnami.com/enterprise${RESET}"
52+
info ""
53+
}
54+

0 commit comments

Comments
 (0)