1
+ ARG imagebase
2
+ FROM ${imagebase} as base
3
+
4
+ FROM registry.access.redhat.com/ubi8/ubi-minimal
5
+
6
+ ARG version
7
+
8
+ LABEL name="MongoDB Agent" \
9
+ version="${agent_version}" \
10
+ summary="MongoDB Agent" \
11
+ description="MongoDB Agent" \
12
+ vendor="MongoDB" \
13
+ release="1" \
14
+
15
+
16
+ COPY --from=base /data/probe.sh /opt/scripts/probe.sh
17
+ COPY --from=base /data/readinessprobe /opt/scripts/readinessprobe
18
+ COPY --from=base /data/version-upgrade-hook /opt/scripts/version-upgrade-hook
19
+ COPY --from=base /data/agent-launcher-lib.sh /opt/scripts/agent-launcher-lib.sh
20
+ COPY --from=base /data/agent-launcher.sh /opt/scripts/agent-launcher.sh
21
+ COPY --from=base /data/LICENSE /LICENSE
22
+
23
+ RUN microdnf install -y --disableplugin=subscription-manager --setopt=install_weak_deps=0 nss_wrapper
24
+ # Copy-pasted from https://www.mongodb.com/docs/manual/tutorial/install-mongodb-enterprise-on-red-hat-tarball/
25
+ RUN microdnf install -y --disableplugin=subscription-manager --setopt=install_weak_deps=0 \
26
+ cyrus-sasl cyrus-sasl-gssapi cyrus-sasl-plain krb5-libs libcurl openldap openssl xz-libs
27
+ # Dependencies for the Agent
28
+ RUN microdnf install -y --disableplugin=subscription-manager --setopt=install_weak_deps=0 \
29
+ net-snmp \
30
+ net-snmp-agent-libs
31
+ RUN microdnf install -y --disableplugin=subscription-manager curl \
32
+ hostname tar gzip procps jq \
33
+ && microdnf upgrade -y \
34
+ && rm -rf /var/lib/apt/lists/*
35
+
36
+
37
+ COPY --from=base /data/mongodb_tools_ubi.tgz /tools/mongodb_tools.tgz
38
+ COPY --from=base /data/mongodb_agent_ubi.tgz /agent/mongodb_agent.tgz
39
+
40
+ RUN tar xfz /tools/mongodb_tools.tgz --directory /tools \
41
+ && rm /tools/mongodb_tools.tgz
42
+
43
+
44
+ RUN tar xfz /agent/mongodb_agent.tgz
45
+ RUN ls /agent
46
+ RUN mv mongodb-mms-automation-agent-*/mongodb-mms-automation-agent /agent/mongodb-agent
47
+ RUN ls /agent
48
+ RUN chmod +x /agent/mongodb-agent
49
+ RUN mkdir -p /var/lib/automation/config
50
+ RUN ls /var/lib/automation/config
51
+ RUN chmod -R +r /var/lib/automation/config
52
+ RUN ls /var/lib/automation/config
53
+ RUN rm /agent/mongodb_agent.tgz
54
+ RUN rm -r mongodb-mms-automation-agent-*
55
+
56
+ USER 2000
57
+
58
+ HEALTHCHECK --timeout=30s CMD ls /opt/scripts/readinessprobe || exit 1
0 commit comments