FIX (ci \ cd): Fix build for MongoDB for target arch

This commit is contained in:
Rostislav Dugin
2025-12-22 14:44:32 +03:00
parent 46512d2bc8
commit b45158afa2

View File

@@ -169,13 +169,16 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
# ========= Install MongoDB Database Tools =========
# Note: MongoDB Database Tools are backward compatible - single version supports all server versions (4.0-8.0)
RUN if [ "$TARGETARCH" = "amd64" ]; then \
# Use apt-get install instead of dpkg -i to automatically resolve dependencies
RUN apt-get update && \
if [ "$TARGETARCH" = "amd64" ]; then \
wget -q https://fastdl.mongodb.org/tools/db/mongodb-database-tools-debian12-x86_64-100.10.0.deb -O /tmp/mongodb-database-tools.deb; \
elif [ "$TARGETARCH" = "arm64" ]; then \
wget -q https://fastdl.mongodb.org/tools/db/mongodb-database-tools-debian12-aarch64-100.10.0.deb -O /tmp/mongodb-database-tools.deb; \
fi && \
dpkg -i /tmp/mongodb-database-tools.deb && \
apt-get install -y --no-install-recommends /tmp/mongodb-database-tools.deb && \
rm /tmp/mongodb-database-tools.deb && \
rm -rf /var/lib/apt/lists/* && \
ln -sf /usr/bin/mongodump /usr/local/mongodb-database-tools/bin/mongodump && \
ln -sf /usr/bin/mongorestore /usr/local/mongodb-database-tools/bin/mongorestore