Docker won't run on Raspberry Pi 5 - <jemalloc>: Unsupported system page size
Describe the bug When trying to run pgcat in Docker on a Raspberry Pi 5, I get the error below and the container won't start. I've tried on 2 different RPi5 with the same error. If I run the container on a Raspberry Pi 4, it works. All 3 RPi are running Debian Bookworm and Docker 28.0.4.
It may not be differences in the RPi5 vs 4 but I'm not sure what else to look into. Any ideas to further trouble shoot would be much appreciated.
docker-compose.yml docker-compose.yml
pgcat:
image: ghcr.io/postgresml/pgcat:latest
networks:
- snuffy2-network
ports:
- 5432:5432 # postgres
# - 9930:9930 # prometheus
environment:
TZ: America/New_York
volumes:
- /etc/localtime:/etc/localtime:ro
- /mnt/gfs/swarm/appdata/pgcat/config/pgcat.toml:/etc/pgcat/pgcat.toml
Docker Logs
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 56 bytes failed
This likely stems from a change to the kernel configuration starting with RPI5: https://github.com/raspberrypi/linux/issues/4375
This affects lots of software - I'd say 1/4 images I run fail to start with this or very similar errors w/ Raspberry Pi OS on a RPI5.
If you use the Ubuntu images for the Raspberry Pi 5, this often is a non-issue (this is what I've started doing to get around this). The kernel in those images includes configuration below.
If you want to keep using Raspberry Pi OS, you can either:
- Switch to
kernel8by adding this to /boot/config.txt
kernel=kernel8.img
- Rebuild the kernel using the following:
CONFIG_ARM64_VA_BITS_39=n
CONFIG_ARM64_VA_BITS_48=y
CONFIG_ARM64_VA_BITS=48
CONFIG_PGTABLE_LEVELS=4
For pgcat, I also had to explicitly target an arm64 build in my cluster. For some reason the linux/arm64 platform wasn't being selected when pulling the image. The image on main might not have an arm build, or more likely it's operator error.
You can nav to Os/Arch here and grab an explicit image tag: https://github.com/postgresml/pgcat/pkgs/container/pgcat/266095057?tag=latest
Example: