-
Notifications
You must be signed in to change notification settings - Fork 121
/
Dockerfile
89 lines (54 loc) · 2.19 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
ARG imagebase
FROM ${imagebase} as base
FROM registry.access.redhat.com/ubi8/ubi
LABEL name="MongoDB Enterprise Database" \
version="2.0.0" \
summary="MongoDB Enterprise Database Image" \
description="MongoDB Enterprise Database Image" \
vendor="MongoDB" \
release="1" \
maintainer="support@mongodb.com"
ENV MMS_HOME /mongodb-automation
ENV MMS_LOG_DIR /var/log/mongodb-mms-automation
RUN yum update -y && rm -rf /var/cache/yum
# these are the packages needed for the agent
RUN yum install -y --disableplugin=subscription-manager \
hostname \
nss_wrapper --exclude perl-IO-Socket-SSL \
procps
# these are the packages needed for MongoDB
# (https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-red-hat-tarball/ "RHEL/CentOS 8" tab)
RUN yum install -y --disableplugin=subscription-manager \
cyrus-sasl \
cyrus-sasl-gssapi \
cyrus-sasl-plain \
krb5-libs \
libcurl \
lm_sensors-libs \
net-snmp \
net-snmp-agent-libs \
openldap \
openssl \
jq
RUN ln -s /usr/lib64/libsasl2.so.3 /usr/lib64/libsasl2.so.2
# Set the required perms
RUN mkdir -p "${MMS_LOG_DIR}" \
&& chmod 0775 "${MMS_LOG_DIR}" \
&& mkdir -p /var/lib/mongodb-mms-automation \
&& chmod 0775 /var/lib/mongodb-mms-automation \
&& mkdir -p /data \
&& chmod 0775 /data \
&& mkdir -p /journal \
&& chmod 0775 /journal \
&& mkdir -p "${MMS_HOME}" \
&& chmod -R 0775 "${MMS_HOME}"
# USER needs to be set for this image to pass RedHat verification. Some customers have these requirements as well
# It does not matter what number it is, as long as it is set to something.
# However, OpenShift will run the container as a random user,
# and the number in this configuration is not relevant.
USER 2000
# The docker image doesn't have any scripts so by default does nothing
# The script will be copied in runtime from init containers and the operator is expected
# to override the COMMAND
ENTRYPOINT ["sleep infinity"]
COPY --from=base /data/licenses/mongodb-enterprise-database /licenses/mongodb-enterprise-database