mirror of
https://github.com/databasus/databasus.git
synced 2026-04-06 00:32:03 +02:00
FIX (mongodb): Fix MongoDB build for ARM
This commit is contained in:
18
Dockerfile
18
Dockerfile
@@ -172,19 +172,23 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
|||||||
|
|
||||||
# ========= Install MongoDB Database Tools =========
|
# ========= Install MongoDB Database Tools =========
|
||||||
# Note: MongoDB Database Tools are backward compatible - single version supports all server versions (4.0-8.0)
|
# Note: MongoDB Database Tools are backward compatible - single version supports all server versions (4.0-8.0)
|
||||||
# Use dpkg with apt-get -f install to handle dependencies
|
# Note: For ARM64, we use Ubuntu 22.04 package as MongoDB doesn't provide Debian 12 ARM64 packages
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
if [ "$TARGETARCH" = "amd64" ]; then \
|
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; \
|
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 \
|
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; \
|
wget -q https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-arm64-100.10.0.deb -O /tmp/mongodb-database-tools.deb; \
|
||||||
fi && \
|
fi && \
|
||||||
dpkg -i /tmp/mongodb-database-tools.deb || true && \
|
dpkg -i /tmp/mongodb-database-tools.deb || apt-get install -f -y --no-install-recommends && \
|
||||||
apt-get install -f -y --no-install-recommends && \
|
rm -f /tmp/mongodb-database-tools.deb && \
|
||||||
rm /tmp/mongodb-database-tools.deb && \
|
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
ln -sf /usr/bin/mongodump /usr/local/mongodb-database-tools/bin/mongodump && \
|
mkdir -p /usr/local/mongodb-database-tools/bin && \
|
||||||
ln -sf /usr/bin/mongorestore /usr/local/mongodb-database-tools/bin/mongorestore
|
if [ -f /usr/bin/mongodump ]; then \
|
||||||
|
ln -sf /usr/bin/mongodump /usr/local/mongodb-database-tools/bin/mongodump; \
|
||||||
|
fi && \
|
||||||
|
if [ -f /usr/bin/mongorestore ]; then \
|
||||||
|
ln -sf /usr/bin/mongorestore /usr/local/mongodb-database-tools/bin/mongorestore; \
|
||||||
|
fi
|
||||||
|
|
||||||
# Create postgres user and set up directories
|
# Create postgres user and set up directories
|
||||||
RUN useradd -m -s /bin/bash postgres || true && \
|
RUN useradd -m -s /bin/bash postgres || true && \
|
||||||
|
|||||||
17
assets/tools/README.md
Normal file
17
assets/tools/README.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
We keep binaries here to speed up CI \ CD tasks and building.
|
||||||
|
|
||||||
|
Docker image needs:
|
||||||
|
- PostgreSQL client tools (versions 12-18)
|
||||||
|
- MySQL client tools (versions 5.7, 8.0, 8.4, 9)
|
||||||
|
- MariaDB client tools (versions 10.6, 12.1)
|
||||||
|
- MongoDB Database Tools (latest)
|
||||||
|
|
||||||
|
For the most of tools, we need a couple of binaries for each version. However, if we download them on each run, it will download a couple of GBs each time.
|
||||||
|
|
||||||
|
So, for speed up we keep only required executables (like pg_dump, mysqldump, mariadb-dump, mongodump, etc.).
|
||||||
|
|
||||||
|
It takes:
|
||||||
|
- ~ 100MB for ARM
|
||||||
|
- ~ 100MB for x64
|
||||||
|
|
||||||
|
Instead of GBs. See Dockefile for usage details.
|
||||||
Reference in New Issue
Block a user