Skip to content

Commit 9daa8b3

Browse files
joanheyfranz1981
authored andcommitted
[toolset] Use Mongodb official image (TechEmpower#7998)
1 parent 3b15579 commit 9daa8b3

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed
+3-26
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,5 @@
1-
FROM ubuntu:22.04
1+
FROM mongo:6.0
22

3-
ARG MONGODB_VERSION=6.0
3+
ENV MONGO_INITDB_DATABASE=hello_world
44

5-
COPY create.js /tmp/
6-
7-
ARG DEBIAN_FRONTEND=noninteractive
8-
ADD "https://www.mongodb.org/static/pgp/server-${MONGODB_VERSION}.asc" \
9-
/etc/apt/keyrings/mongodb-org.asc
10-
RUN apt-get -yqq update && \
11-
apt-get -yqq install \
12-
apt-utils \
13-
ca-certificates \
14-
lsb-release && \
15-
chmod 644 /etc/apt/keyrings/mongodb-org.asc && \
16-
echo "deb [ signed-by=/etc/apt/keyrings/mongodb-org.asc ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/${MONGODB_VERSION} multiverse" > \
17-
/etc/apt/sources.list.d/mongodb-org.list && \
18-
apt-get -yqq update && \
19-
# Complete and utter hax if it works
20-
ln -s /bin/echo /bin/systemctl && \
21-
apt-get -yqq install mongodb-org && \
22-
install -dm777 /data/db && \
23-
mongod --fork --logpath /var/log/mongodb.log --bind_ip_all && \
24-
sleep 10 && \
25-
mongosh < /tmp/create.js && \
26-
sleep 10
27-
28-
CMD ["mongod", "--bind_ip_all"]
5+
COPY create.js /docker-entrypoint-initdb.d/

0 commit comments

Comments
 (0)