Changes to Dockerfile to fix error in installing MongoDB
This commit is contained in:
@@ -20,12 +20,14 @@ RUN apt-get update && apt-get install -y \
|
|||||||
gnupg \
|
gnupg \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
lsb-release \
|
lsb-release \
|
||||||
&& wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add - \
|
sudo \
|
||||||
&& echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/debian $(lsb_release -c | awk '{print $2}')/mongodb-org/5.0 main" > /etc/apt/sources.list.d/mongodb-org-5.0.list \
|
shadow && \
|
||||||
&& apt-get update && apt-get install -y mongodb-org \
|
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add - && \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/debian $(lsb_release -c | awk '{print $2}')/mongodb-org/5.0 main" > /etc/apt/sources.list.d/mongodb-org-5.0.list && \
|
||||||
|
apt-get update && apt-get install -y mongodb-org && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Create mongodb user and group
|
# Create mongodb user and group in the final image
|
||||||
RUN getent group mongodb || groupadd -r mongodb && \
|
RUN getent group mongodb || groupadd -r mongodb && \
|
||||||
getent passwd mongodb || useradd -r -g mongodb mongodb
|
getent passwd mongodb || useradd -r -g mongodb mongodb
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user