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
Missing python3 and cpu-feauture (optional) dependencies when doing docker deployment. #7523
Comments
Hi! Yeah, if deps are now required which are built using node-gyp, you'll need python in the image. Would you mind trying to add a step for that and see if it resolves the problem? |
@freben I've solved it by adding this line within my 2 dockerfiles RUN apt-get update && apt-get -y install python3 cmake g++ I honestly think this line should be included in the docs. |
Also, regarding cpu-features package. It says it's an optional dependency I can see it inside the main yarn.lock file so even if I delete it it still tries to install it [5/5] Building fresh packages...
warning Error running install script for optional dependency: "/app/node_modules/cpu-features: Command failed. any way I can remove it ? it is optional, right ? or is it not ? |
Hm I'm not sure if it's actually optional and what to do about that honestly. In any case, yeah node-gyp will be needed. We'd appreciate if you added the python installation to the docs. |
Generally node-gyp shouldn't need to be invoked as it's often just a fallback for when there aren't any published binaries, although that's not always the case. To clarify the original issue, does this break the build or does it continue on to create a working image but you are concerned about the error? It may be that we simply want to document that there will be a warning that can be ignored, but if you want to avoid it you can add the python installation to the docker build |
Mostly concerned. Nope it does not break the build. I see the error in every That's essentially what I want to know, can this be ignored ? why is cpu-features there? when I look for that dependency in this repo I cant find it. It seems to me that I can. Also , for multi-stage build if I adding apt-get update + python3 adds an extra 300 MB to the backend container, so theres that |
It's definitely safe to ignore. It's used by ssh2 to optimize the cipher ordering based on hardware features of the CPU. The I would avoid adding python as it's just gonna slow down the build process with no real benefit. It's a shame there's no way to opt-out of specific dependencies or anything like that (that I know of). Seems to be something we just need to live with tbh yarnpkg/yarn#3738 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Since backstage 0.4.19, and swapping out |
I'm running into this as well, out of the box installation results in a failed docker build: #10 73.96 error /app/node_modules/@vscode/sqlite3: Command failed. and then a lot of node-gyp output trying to find Python. |
Having the same problem. But installing python, cmake and g++ in the production image is not really an option, right? It fixes the issue of the dependencies, but then you have compilers in the image which could pose a security risk. @backstage-team: Any chance that |
Followed this guide an created 2 images with a separate frontend. I get 2 dependencies errors using the provided Dockerfiles (everything out of the box). Issue happens on Backend and frontend. Do I need to install python3 ? it's not specified on the instructions
Steps to Reproduce
Backend Dockerfile
Frontend Dockerfile
Everything is built using create-app and deployment using docker with a separate image in the frontend.
Yarn.lock has the cpu-feature dependency
The text was updated successfully, but these errors were encountered: