Muhammad Arslan Akhtar
Muhammad Arslan Akhtar

Reputation: 557

Build mongodb docker image for arm64 raspberry pi 4 using official or bitnami mongodb docker image

I tried to install helm chart from bitnami/mongodb on arm64 raspberry pi 4 running Ubuntu 20.04 LTS 64bit. The container starts but then immediately terminates itself. I think it's because the mongodb image from bitnami isn't compatible with arm64 architecture.

How can I build mongodb or any other arm64 architecture compatible docker image or helm chart using the corresponding official docker image from x86_x64 laptop?

Upvotes: 2

Views: 5368

Answers (2)

Dimitri Lavrenük
Dimitri Lavrenük

Reputation: 4889

Sadly it is still a problem in 2025.

I did not find another solution than to build a custom arm docker image based on official bitnami/mongodb and official mongodb Dockerfiles. Currently versions 6.x and 8.x can be found on Docker Hub and the source code is available on https://github.com/dlavrenuek/bitnami-mongodb-arm. Please note that these are not official images and their intention is to be used for development only.

Building bitnami/mongodb 8.x compatible image was a challenge since official mongo binaries require libraries that are only available in stable ubuntu but not a stable release of Debian (12), which the bitnami images use (bitnami/minideb). In the linked repository you can find a custom minideb build based on Debian 13 (trixie), which is currently in testing state and should be released as stable this year.

Upvotes: 0

Muhammad Arslan Akhtar
Muhammad Arslan Akhtar

Reputation: 557

I made it work by modifying helm chart to pull arm64 compatible image of mongodb. Here is the code:

helm install mongodb bitnami/mongodb
  --set image.repository=arm64v8/mongo
  --set image.tag=latest
  --set persistence.mountPath=/data/db

These are the minimum set of config we need to override inorder to make it work. The rest of the environment parameters like --set mongodbRootPassword=<?> --set mongodbUsername=<?> --set mongodbPassword=<?> --set mongodbDatabase=<?> will not work on arm64v8/mongo image as these env params are bitnami/mongodb image specific. I suggest to modify bitnami/mongodb helm templete's to make it compatible with arm64v8/mongo environment variables

Upvotes: 2

Related Questions