Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get this working on a raspberry pi #403

Closed
Chief-T1 opened this issue Feb 27, 2023 · 9 comments
Closed

How to get this working on a raspberry pi #403

Chief-T1 opened this issue Feb 27, 2023 · 9 comments
Assignees

Comments

@Chief-T1
Copy link

Hi,

I've been trying to get this working on a raspberry pi. I've had numerous issues.
The first was related to the alpine linux version not working, related to this issue: nodejs/docker-node#1589.

I fixed this by changing the Dockerfiles build line to this: FROM node:18-alpine

I've now got issues with MongoDB not connecting and I am getting the following errors:

WARNING: MongoDB 5.0+ requires ARMv8.2-A or higher, and your current system does not appear to implement any of the common features for that!
  see https://jira.mongodb.org/browse/SERVER-55178
  see also https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features
  see also https://github.com/docker-library/mongo/issues/485#issuecomment-970864306
/usr/local/bin/docker-entrypoint.sh: line 414:    28 Illegal instruction     "${mongodHackedArgs[@]}" --fork

I've read online that I need to use an older version of MongoDB and so have changed the image in my docker compose file to use mongo:4.4. I'm still getting errors, can you please advise what else I need to change to get this to work?

The docker compose file I'm using is below:

version: "3.4"

services:
  mongo:
    image: mongo:4.4
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: root
    volumes:
      - mongo_db:/data/db

  backend:
    build:
      context: ./api
      dockerfile: ./Dockerfile
    volumes:
      - type: bind
        source: ./api
        target: /api
    depends_on:
      - "mongo"


  frontend:
    build:
      context: ./app
    depends_on:
      - "backend"


volumes:
  mongo_db:

Thank you

@georgegebbett
Copy link
Owner

Hi there

What is the latest error message you are getting? I am not having any issues with the dockerfile as above 🤔

@georgegebbett georgegebbett self-assigned this Feb 27, 2023
@Chief-T1
Copy link
Author

I'm getting different variations of this error in a loop:

WARNING: MongoDB 5.0+ requires ARMv8.2-A or higher, and your current system does not appear to implement any of the common features for that! see https://jira.mongodb.org/browse/SERVER-55178 see also https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features see also https://github.com/docker-library/mongo/issues/485#issuecomment-970864306 /usr/local/bin/docker-entrypoint.sh: line 414: 28 Illegal instruction "${mongodHackedArgs[@]}" --fork

The variations are on the last line and are the following:

  • '25 Illegal instruction'
  • '26 Illegal instruction'
  • '27 Illegal instruction'
  • '28 Illegal instruction'

If I google it I come across issues like the below which seem to suggest the error is a result of mongo version 5 being unsupported on a raspberry pi. I've tried to change the compose file to use mongo:4.4 as the image but I'm not sure if there's anywhere else I should change this.

docker-library/mongo#510
https://stackoverflow.com/questions/68392064/error-when-running-mongo-image-docker-entrypoint-sh-line-381

@GermanAizek
Copy link

@Chief-T1,
Most likely this is due to the fact that MongoDB 5.0+ requires AVX instructions, have you tried removing optimizations for sandy bridge CPU's? You can look at my patch, where exactly this can be removed.
https://github.com/GermanAizek/mongodb-without-avx

@Chief-T1
Copy link
Author

Chief-T1 commented Mar 1, 2023

Hi @GermanAizek

Thank you for the help. I have to admit your page although very well written does look a bit too technical for me at first glance. I think I need a few days to really understand the process.

Just a couple quick questions:

  • Is this a process I can move into docker? I get the impression that your how-to is aimed at installing on the host?
  • Would sandy bridge optimisations still be an issue if I'm trying to use MongoDB 4.4 as my docker base image?

Thank you in advance.

@GermanAizek
Copy link

@Chief-T1,
Thank you very much for idea, I can package this for you in dockerfile and build packages via Github Actions. I'll do it today, as soon as I notify you.

@Chief-T1
Copy link
Author

Chief-T1 commented Mar 1, 2023

@GermanAizek,
Thank you so much, that would be really helpful! You're a legend!

@steiditi
Copy link

I have the same problem. Did it work? How do I use this?

@GermanAizek
Copy link

@steiditi,
Use Dockerfile or rebuild with no-avx patch.
More info here: https://github.com/GermanAizek/mongodb-without-avx

@georgegebbett
Copy link
Owner

Hi all - apologies for the delay on this one - I have just released V2 of Recipe Buddy which removes the dependency on Mongo and should therefore run on a much wider range of devices - please do give it a go and let me know what you think :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants