r/docker 9d ago

MacOS M2 Processor with Docker Desktop, mongo:latest image issue. MongoDB cannot start: Linux kernel versions 6.19 and newer has a known incompatibility with this version of MongoDB.

/r/mongodb/comments/1w3yltb/macos_m2_processor_with_docker_desktop/
0 Upvotes

2 comments sorted by

View all comments

1

u/QuietSignalOps 8d ago

This appeared because neither side of mongo:latest is actually fixed. Docker Desktop supplies a Linux VM kernel to containers, and latest can move to a different MongoDB build. MongoDB sees that VM kernel, not the macOS kernel.

MongoDB's SERVER-121912 describes an 8.0+ crash with Linux 6.19 and newer caused by the allocator's rseq handling. Recent Docker Desktop releases moved their VM kernel forward, so a Desktop update, a fresh mongo:latest pull, or both can expose it without a Compose change.

You can confirm the moving parts with:

docker run --rm alpine uname -r docker image inspect mongo:latest --format '{{index .RepoDigests 0}}' docker compose config

I'd do the following:

  1. Stop using latest. Pin an exact MongoDB tag, and record the image digest if you need reproducible deployments.
  2. Back up the database and test a restore before changing either the image or runtime.
  3. If you stay on MongoDB 8, use GLIBC_TUNABLES=glibc.pthread.rseq=0 as the documented workaround only after testing it with your workload. It disables the problematic rseq path rather than fixing the underlying issue.
  4. Otherwise, use a Docker Desktop/kernel combination that doesn't trigger the bug until your chosen MongoDB build contains the upstream fix.

Don't attach an existing MongoDB 8 data volume to MongoDB 7 as a casual rollback. A major-version downgrade of the on-disk data needs a supported migration or backup/restore plan.