-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathubuntu18-mongod.dockerfile
29 lines (23 loc) · 1.16 KB
/
ubuntu18-mongod.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
FROM "ubuntu:18.04"
LABEL __copyright__="(C) Guido Draheim, licensed under the EUPL" \
__version__="1.5.8065"
EXPOSE 27017
RUN apt-get update
RUN apt-get install -y python3
COPY files/docker/systemctl3.py /usr/bin/systemctl
RUN test -L /bin/systemctl || ln -sf /usr/bin/systemctl /bin/systemctl
RUN apt-get install -y wget gnupg
RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add -
RUN echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" \
| tee /etc/apt/sources.list.d/mongodb-org-4.4.list
RUN apt-get update
RUN apt-get install -y mongodb-org
COPY files/docker/systemctl3.py /usr/bin/systemctl
RUN sed -i "s|^ bindIp:.*| bindIp: 0.0.0.0|" /etc/mongod.conf
RUN sed -i -e "/processManagement/a\\" -e " pidFilePath: /var/run/mongodb/mongod.pid" /etc/mongod.conf
RUN sed -i -e "/PIDFile=/a\\" -e "RuntimeDirectory=mongodb" /lib/systemd/system/mongod.service
# systemctl3.py can not find the child process being the new MAINPID but mongodb can tell about it
RUN systemctl enable mongod
RUN touch /var/log/systemctl.debug.log
# CMD /usr/bin/systemctl # FIXME
CMD /usr/bin/systemctl init mongod