RocketChat / Docker.Official.Image

Docker hub - community managed image
291 stars 217 forks source link

[compose.yml] bitnami/mongodb crashes with Illegal instruction on Apple Silicon #204

Open DarhkVoyd opened 6 months ago

DarhkVoyd commented 6 months ago

Context

As per official deploy docs: here

docker compose up -d

This command will:

Description

When following the docs on Apple Silicon devices trying to run a RocketChat instance using docker compose. The Rocket.Chat container will run fine but the MongoDB will repeatedly crash unable to run the bitnami/mongodb container. The following error is displayed in the container logs:

2024-02-05 18:43:40 mongodb 13:13:40.83 INFO  ==> Initializing MongoDB...
2024-02-05 18:43:41 mongodb 13:13:41.01 INFO  ==> Deploying MongoDB from scratch...
2024-02-05 18:43:41 /opt/bitnami/scripts/libos.sh: line 346:   210 Illegal instruction     "$@" > /dev/null 2>&1

Solution

Apparently, it is due to QEMU not supporting emulating AVX instructions on ARM64 in Docker but only recently this issue has been somewhat solved. For now, this error can be solved by adding the following variable to the mongodb service environments for Apple Silicon devices in compose.ytml:

EXPERIMENTAL_DOCKER_DESKTOP_FORCE_QEMU: 1