简体   繁体   中英

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.

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

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM