18

I need to run MongoDB docker container on Raspberry Pi 4B. My Raspberry has preset (already installed) Raspbian on SD card, I didn't install OS by myself.

MongoDB docker image supports arm64v8. But when I try to run container, it claims that there is no image available for my armv7 32-bit machine.

Official Raspberry Pi 4B specification claims that it has ARMv8 processor so mongodb should install without any problems. It turns out it's not a problem with Mongo, as linux command lscpu also claims my machine is armv7l.

What would you recommend me to do now? Can I somehow configure raspbian so it claim it works on armv8?

Piotrek
  • 283
  • 1
  • 2
  • 5

2 Answers2

13

Docker containers use the same kernel as the host. There are two pre-compiled kernels distributed with Raspbian, an ARMv6 one for the model 1's and Zeros, and an ARMv7 one for the multicore models. The latter works on the 64-bit ARMv8 models as well,1 since they are backward compatible.

You cannot run a 64-bit userspace on top of a 32-bit kernel. While you could use a 64-bit kernel, this means compiling it yourself or finding a distro that has one.

Unfortunately Mongo DB dropped support for 32-bit platforms last year. Your best bet is to try a 64-bit distro; if you search around online you'll find blogs about this, eg.: https://andyfelong.com/2019/01/mongodb-3-2-64-bit-running-on-raspberry-pi-3-with-caveats/

2020 Update: There is a beta version of 64-bit Raspbian/RpiOS available which seems to work fine and thus should support MongoDB.


  1. The oddball in this is really the Pi 2B, which is a 32-bit ARMv7 dual core. This is when the second stock kernel was introduced.
goldilocks
  • 60,325
  • 17
  • 117
  • 234
12

The Raspberry Pi 3 and 4 have 64-bit CPUs. However, Raspbian is a 32-bit operating system, so that SD card images work on all Pi models. Depending on where you're looking, the Pi will report armv6 or armv7 (usually armv7) although it's actually running in armv6 userland, and despite the hardware is actually armv8. Some other operating systems provide 64-bit images but they're less common.

ben_nuttall
  • 2,471
  • 14
  • 15