-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: add libelf1 #363
feat: add libelf1 #363
Conversation
libelf1 is required by Flowtype (https://flowtype.org/) to store binaries and extract them at the runtime. Running `flow-bin` on a machine without libelf1 will product the following error: ``` /srv/node_modules/flow-bin/flow-linux64-v0.41.0/flow: error while loading shared libraries: libelf.so.1: cannot open shared object file: No such file or directory ``` https://www.npmjs.com/package/flow-bin is a popular program (over 880k downloads a month). Lack of an official Node.js image with flow-bin support results in a lot of avoidable image builds for the sole purpose of adding libelf1. Adding libelf1 increases the final image size by 2MB (from 666MB to 668MB, measured using the 7.7 base image).
I might be wrong but it appears that the v4 is failing for an unrelated reason. @Starefossen Can you take a look? It probably requires to simply restart the job. |
The problem with adding library that are not essential to run node is that we would have to create a process to deal with every request of this type to determine what would go in and what wouldn't, which could get messy. I would rather have the minimum in the base image and implementers create their image on top of it. |
I agree with @LaurentGoderre. I'd also add that the |
While I agree keeping the image as small as possible, the «main» Node.js image variant already contains quit a few packages which is strictly not necessary to run Node.js (yes, those are installed by the parent image, but still). Production container use cases should use the |
So with that logic I guess we just keep adding libraries and packages to the base node image whenever an issue like this comes up? Where do we draw the line? |
I see your point @chorrell; I can not recall too many cases like this in the past and as I mentioned to @gajus there are alternative Docker images with Node.js and pre-installed libelf available from Docker Hub. |
Based on similar discussions in #367 I'm 👎 on this. The base node image, for historical reasons, was more like a "developer" image where all kinds of things were pre-installed via Image size has been a pretty considerable complaint because of this and lead to the creation of the We usually recommend using the I guess the other, bigger issue here is that when you install a package with npm, you don't always know what system dependencies are required (e.g, the libelf1 lib). That's a pretty common issue we hit with the |
Understood. Thank you for all for the discussion. It appears the majority is against the addition. I will communicate an update when there is a resolution in the Flowtype community. |
I need this as well, @gajus Do you have a Docker image with Flow? Can you please share it? |
A new version of Flowtype is coming out in a not too distant future that will drop libelf1 dependency. I will share an update here once it is out. |
@gajus is there a issue to track removing |
@mattbailey |
@xdissent I think this is the case for many dependencies. Hopefully as alpine gains momentum, will become clear that maintaining musl binaries is a must for the ecosystem. One thing that would be nice though would be a parameter in node specifying the compiler used so we can do detection on platform, architecture and compiler. Right now I haven't found a way to do that! |
|
Addressed in Flow v0.48:
https://github.com/facebook/flow/blob/master/Changelog.md#0480 |
Great news @gajus 🎉 |
libelf1 is required by Flowtype (https://flowtype.org/) to store binaries and extract them at the runtime. Running
flow-bin
on a machine without libelf1 will product the following error:https://www.npmjs.com/package/flow-bin is a popular program (over 880k downloads a month). Lack of an official Node.js image with flow-bin support results in a lot of avoidable image builds for the sole purpose of adding libelf1.
Adding libelf1 increases the final image size by 2MB (from 666MB to 668MB, measured using the 7.7 base image).
Fixes: