Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when running mongo image - docker-entrypoint.sh: line 381

After installing Ubuntu v20 and then installing docker:

$ docker network create test-network

$ docker pull mongo

$ docker run --network test-network --name mongodb \
    -e MONGO_INITDB_ROOT_USERNAME=admin \
    -e MONGO_INITDB_ROOT_PASSWORD=pawwrord \
    mongo

I got an error like this:

/usr/local/bin/docker-entrypoint.sh: line 381:    25 Illegal instruction     (core dumped) "${mongodHackedArgs[@]}" --fork

Do you know what the problem is? I just need some guidance to investigate the problem.

UPDATE

I don't have any problem with other docker hub images.

Specifically only when I want to run mongo, I got this error.

like image 815
MohammadReza Avatar asked Jul 15 '21 10:07

MohammadReza


3 Answers

MongoDB 5.0 requires a Sandy Bridge or newer CPU. Get a newer processor or use an older version of MongoDB.

https://jira.mongodb.org/browse/SERVER-54407

like image 163
D. SM Avatar answered Oct 21 '22 04:10

D. SM


I have exactly same problem with yours, i try to run on my local computer work but not in VM.

thanks to this I simply changed mongo's version to 4.4 from latest which is 5.0 and running well. Maybe need newer CPU

like image 34
adam syarif Avatar answered Oct 21 '22 04:10

adam syarif


It's a shortcoming in the available instructions of your CPU. Mongo 5.0 requires CPU instructions only available in Sandy Bridge era or more recent.

I had this problem using a Proxmox VM, which defaults to a simpler virtual CPU. Simply changing the virtual CPU to type "host" fixed the problem, by allowing the VM CPU to include all the instructions of the host CPU.

If you are running directly on metal, you'll need a newer CPU. Good luck!

like image 28
moodboom Avatar answered Oct 21 '22 03:10

moodboom