Changes to Dockerfile to fix error in installing MongoDB
This commit is contained in:
@@ -24,7 +24,16 @@ RUN apt-get update && apt-get install -y \
|
|||||||
lsb-release \
|
lsb-release \
|
||||||
sudo && \
|
sudo && \
|
||||||
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add - && \
|
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add - && \
|
||||||
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 && \
|
# Dynamically set the architecture and MongoDB version
|
||||||
|
ARCH=$(uname -m) && \
|
||||||
|
if [ "$ARCH" = "x86_64" ]; then \
|
||||||
|
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; \
|
||||||
|
elif [ "$ARCH" = "aarch64" ]; then \
|
||||||
|
echo "deb [ arch=arm64 ] 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; \
|
||||||
|
else \
|
||||||
|
echo "Unsupported architecture $ARCH"; \
|
||||||
|
exit 1; \
|
||||||
|
fi && \
|
||||||
apt-get update && apt-get install -y mongodb-org && \
|
apt-get update && apt-get install -y mongodb-org && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user