-
Notifications
You must be signed in to change notification settings - Fork 121
/
Dockerfile
44 lines (35 loc) · 1.57 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
ARG imagebase
FROM ${imagebase} as base
FROM registry.access.redhat.com/ubi7/ubi
ARG agent_version
LABEL name="MongoDB Agent" \
version="${agent_version}" \
summary="MongoDB Agent" \
description="MongoDB Agent" \
vendor="MongoDB" \
release="1" \
maintainer="support@mongodb.com"
RUN yum install -y --disableplugin=subscription-manager -q curl \
hostname nss_wrapper --exclude perl-IO-Socket-SSL procps \
&& yum upgrade -y -q \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /agent \
&& mkdir -p /var/lib/mongodb-mms-automation \
&& mkdir -p /var/log/mongodb-mms-automation/ \
&& chmod -R +wr /var/log/mongodb-mms-automation/ \
# ensure that the agent user can write the logs in OpenShift
&& touch /var/log/mongodb-mms-automation/readiness.log \
&& chmod ugo+rw /var/log/mongodb-mms-automation/readiness.log
COPY --from=base /data/mongodb-agent.tar.gz /agent
COPY --from=base /data/mongodb-tools.tgz /agent
COPY --from=base /data/LICENSE /licenses/LICENSE
RUN tar xfz /agent/mongodb-agent.tar.gz \
&& mv mongodb-mms-automation-agent-*/mongodb-mms-automation-agent /agent/mongodb-agent \
&& chmod +x /agent/mongodb-agent \
&& mkdir -p /var/lib/automation/config \
&& chmod -R +r /var/lib/automation/config \
&& rm /agent/mongodb-agent.tar.gz \
&& rm -r mongodb-mms-automation-agent-*
RUN tar xfz /agent/mongodb-tools.tgz --directory /var/lib/mongodb-mms-automation/ && rm /agent/mongodb-tools.tgz
USER 2000
CMD ["/agent/mongodb-agent", "-cluster=/var/lib/automation/config/automation-config.json"]