Skip to content

Commit fcaced1

Browse files
authored
HELP-34894 Add missing Agent Dockerfile (#229)
1 parent c17943a commit fcaced1

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
ARG imagebase
2+
FROM ${imagebase} as base
3+
4+
FROM registry.access.redhat.com/ubi8/ubi-minimal
5+
6+
ARG agent_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+
maintainer="support@mongodb.com"
15+
16+
RUN microdnf install -y --disableplugin=subscription-manager curl \
17+
hostname nss_wrapper tar gzip procps\
18+
&& microdnf upgrade -y \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
RUN mkdir -p /agent \
22+
&& mkdir -p /var/lib/mongodb-mms-automation \
23+
&& mkdir -p /var/log/mongodb-mms-automation/ \
24+
&& chmod -R +wr /var/log/mongodb-mms-automation/ \
25+
# ensure that the agent user can write the logs in OpenShift
26+
&& touch /var/log/mongodb-mms-automation/readiness.log \
27+
&& chmod ugo+rw /var/log/mongodb-mms-automation/readiness.log
28+
29+
30+
COPY --from=base /data/mongodb-agent.tar.gz /agent
31+
COPY --from=base /data/mongodb-tools.tgz /agent
32+
COPY --from=base /data/LICENSE /licenses/LICENSE
33+
34+
RUN tar xfz /agent/mongodb-agent.tar.gz \
35+
&& mv mongodb-mms-automation-agent-*/mongodb-mms-automation-agent /agent/mongodb-agent \
36+
&& chmod +x /agent/mongodb-agent \
37+
&& mkdir -p /var/lib/automation/config \
38+
&& chmod -R +r /var/lib/automation/config \
39+
&& rm /agent/mongodb-agent.tar.gz \
40+
&& rm -r mongodb-mms-automation-agent-*
41+
42+
RUN tar xfz /agent/mongodb-tools.tgz --directory /var/lib/mongodb-mms-automation/ && rm /agent/mongodb-tools.tgz
43+
44+
USER 2000
45+
CMD ["/agent/mongodb-agent", "-cluster=/var/lib/automation/config/automation-config.json"]
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
ARG imagebase
2+
FROM ${imagebase} as base
3+
4+
FROM ubuntu:20.04
5+
6+
ARG agent_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+
maintainer="support@mongodb.com"
15+
16+
RUN apt-get -qq update \
17+
&& apt-get -y -qq install \
18+
curl \
19+
libnss-wrapper \
20+
&& apt-get upgrade -y -qq \
21+
&& apt-get dist-upgrade -y -qq \
22+
&& rm -rf /var/lib/apt/lists/*
23+
RUN mkdir -p /agent \
24+
&& mkdir -p /var/lib/mongodb-mms-automation \
25+
&& mkdir -p /var/log/mongodb-mms-automation/ \
26+
&& chmod -R +wr /var/log/mongodb-mms-automation/ \
27+
# ensure that the agent user can write the logs in OpenShift
28+
&& touch /var/log/mongodb-mms-automation/readiness.log \
29+
&& chmod ugo+rw /var/log/mongodb-mms-automation/readiness.log
30+
31+
32+
COPY --from=base /data/mongodb-agent.tar.gz /agent
33+
COPY --from=base /data/mongodb-tools.tgz /agent
34+
COPY --from=base /data/LICENSE /licenses/LICENSE
35+
36+
RUN tar xfz /agent/mongodb-agent.tar.gz \
37+
&& mv mongodb-mms-automation-agent-*/mongodb-mms-automation-agent /agent/mongodb-agent \
38+
&& chmod +x /agent/mongodb-agent \
39+
&& mkdir -p /var/lib/automation/config \
40+
&& chmod -R +r /var/lib/automation/config \
41+
&& rm /agent/mongodb-agent.tar.gz \
42+
&& rm -r mongodb-mms-automation-agent-*
43+
44+
RUN tar xfz /agent/mongodb-tools.tgz --directory /var/lib/mongodb-mms-automation/ && rm /agent/mongodb-tools.tgz
45+
46+
USER 2000
47+
CMD ["/agent/mongodb-agent", "-cluster=/var/lib/automation/config/automation-config.json"]

0 commit comments

Comments
 (0)