Closed spkane closed 9 months ago
Hi @spkane, very sorry to hear about your issue.
Here's my understanding:
amd64
platforms, MongoDB requires a CPU with AVX support, see https://jira.mongodb.org/browse/SERVER-54407. If you use the official MongoDB image mongo:6.0
, instead of bitnami/mongodb:6.0
, you'll see an error message that's clearer than just Illegal instruction
.--> The switch to Rosetta by default in Docker Desktop doesn't really have an impact. With or without Rosetta, the bitnami/mongodb:6.0
image would fail either way.
There are two ways you can work around this issue:
arm64
, That's the fastest, most straightforward solution: docker run --rm --platform linux/arm64 --name mongo mongo:6.0
.-e EXPERIMENTAL_DOCKER_DESKTOP_FORCE_QEMU=1
to your docker run command. That'll bypass Rosetta just for this container and keep the faster Rosetta as the default.I've just tested those three options and they all work:
on 4.26.1 and 4.27: docker run --rm --platform linux/arm64 mongo:6.0
on 4.27: docker run --rm --platform linux/amd64 -e EXPERIMENTAL_DOCKER_DESKTOP_FORCE_QEMU=1 bitnami/mongodb:6.0
on 4.27: docker run --rm --platform linux/amd64 -e EXPERIMENTAL_DOCKER_DESKTOP_FORCE_QEMU=1 mongo:6.0
Hi @spkane, Docker Desktop 4.27 has been released. I'd love to get your feedback!
@dgageot With the 4.27 release:
$ docker run --rm --platform linux/amd64 -ti mongo:6.0
WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
see https://jira.mongodb.org/browse/SERVER-54407
see also https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2
see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814
And then it just sort of hard locks, until I stop it from another terminal. Control-C does not work...
$ docker run --rm --platform linux/amd64 -e EXPERIMENTAL_DOCKER_DESKTOP_FORCE_QEMU=1 -ti mongo:6.0
WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
see https://jira.mongodb.org/browse/SERVER-54407
see also https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2
see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814
{"t":{"$date":"2024-01-26T18:53:30.727+00:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"-","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
...
This appears to work and responds to a Control-C to stop it.
So, this appears to look promising.
Now, I need to actually dig into the initial problem I was having, because I think I accidentally found this AVX issue while trying to troubleshoot an issue running mongo 4.4 (which does not require AVX). I just happened to test 6.0 as well to see if it was just a problem with the older mongo image and when I saw another startup error, I thought that they were the same.
I may have a second issue to open up regarding Rosseta emulation, because the mongo 4.4 amd64 container I have been using was fine with QEMu, but broke once Rosetta was default forced.
@dgageot This can probably be closed now. The lack of AVX support in Rosseta 2 is something that isn't going to be fixed, and the workarounds that Docker is providing appear to work. Thanks!
@spkane Thanks for the feedback! And feel free to open another issue for 4.4 if there's still an problem.
Description
The switch to requiring users to use Rosetta instead of QEMU has broken things significantly, and there is no obvious way to revert to the old QEMU-based behavior in Docker Desktop for Mac.
Reproduce
It is really easy to reproduce the core issue here with a test comment like this:
Note the Illegal instruction error message at the end. You get this when you run basically any binary inside the container.
Expected behavior
lscpu
CPU op-mode(s) output should show support for 32-bit and 64-bit.The Rosetta support needs to be fixed, if it is going to be required and in the meantime, there need to be a way for people to revert to the old QEMU behavior until there is a fix that allows Rosetta to handle x86_64 properly.
docker version
docker info
Diagnostics ID
63AA3B70-500A-4E8E-A5AB-028E750737C9/20240119204843
Additional Info
The
lscpu
output: