Version
All Domino versions
Issue
Unable to install mongod on a workspace using a custom environment build using the the following
dockerfile instruction set:
USER root
RUN apt-get install gnupg \
&& wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - \
&& echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list \
&& apt-get update \
&& apt-get install -y mongodb-org
ENTRYPOINT ["mongod"]
Root Cause:
The build successfully completes without issue however when loading a workspace with the environment you are left with no running mongod instance. This is becuase when using ENTRY POINT ["mongod"] docker assumes that you will be running the mongo daemon using systemd and hence it fails since systemd is non existent.
You will see this when manually attempting to install mongod on a workspace:
Adding user `mongodb' to group `mongodb' ...
Adding user mongodb to group mongodb
Done.
System has not been booted with systemd as init system (PID 1). Can't operate.
Resolution:
To start up Mongod outside of systemd by specifying the --config flag and sending the command to the background using &
You would need to edit your docker instruction as follows:
USER root
RUN apt-get install gnupg \
&& wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - \
&& echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list \
&& apt-get update \
&& apt-get install -y mongodb-org
In addition to this, you would also require a pre-run script to ensure that mongo has access to its libraries and logs :
sudo chown -R ubuntu.mongodb /var/lib/mongodb/
sudo chown -R ubuntu.mongodb /var/log/mongodb/
mongod --config /etc/mongod.conf &
Comments
0 comments
Please sign in to leave a comment.