-
Notifications
You must be signed in to change notification settings - Fork 247
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
Provide statically-linked musl binary for Alpine Linux #473
Comments
Hi @BryanHunt, thanks for reporting this! I'll admit to not having experience with Docker (though I'm going to look into it a bit since this Dockerfile seems straightforward enough). This is a strange one, as the error seems to indicate that the installer worked and correctly modified the profile, but that that it failed to install the files (which it would do first, and so if that failed the rest shouldn't have happened). Can you show the contents of |
I think the issue is that there are some shared system libraries missing and the error message is misleading. |
Thanks for the follow-up @BryanHunt. That would definitely be misleading if the root cause was an inability to find shared libraries. While we can’t do much to fix bash having bad errors, with some investigation, we may be able to better document the required libraries. |
@BryanHunt I dug in a bit with that Dockerfile, and you're right, there are a number of shared libraries that aren't available with that setup of Alpine. The biggest issue is that the current builds of Volta are all dynamically linked to glibc, while Alpine is built using musl libc. We have talked in the past about doing some static linking in Volta (when we were looking at OpenSSL compatibility issues), but we ultimately decided against it for a number of reasons. We could discuss the idea of providing a fully statically-linked version as an advanced option, with the disclaimers that the end-user is responsible for keeping it up-to-date as that version won't be getting security updates from the shared libraries on the system. |
Tracking in the Updates / Notifications project, as if we make a statically-linked binary, we should absolutely have a path for upgrading and notifying users that a new version is available. |
This would be a great feature for docker based CI and development environments since alpine based containers are extremely slim. Would appreciate if someone look into this or/and if we get an official image on docker hub just like official github actions. |
I'd really appreciate a way to run volta on an alpine docker image as well! |
I can install it fine, however it wont execute.. really strange: My install script is like:
then trying to run:
Edit: digging deeper,
We can add some compat. like so:
Which fixes one of the shared library issues, however.. I get this still:
|
OK for those looking for a solution you can duplicate what is done here: https://github.com/Docker-Hub-frolvlad/docker-alpine-glibc/blob/master/Dockerfile This adds glibc. So I didn't really trust using that docker image by the way.. so I copied that into my own, then after that I ran the following:
from here I get:
Woohoo! So from here I tried to run node:
Yikes, ok, my attempt to fix it:
Umm, it kind of works? With a bunch of warnings.. still investigating, but here if anyone has pointers |
I've managed to compile and run a next.js project with it. The REPL seems to work fine, with some warnings of course # node
node: /usr/lib/libstdc++.so.6: no version information available (required by node)
node: /usr/lib/libstdc++.so.6: no version information available (required by node)
node: /usr/lib/libstdc++.so.6: no version information available (required by node)
node: /usr/lib/libstdc++.so.6: no version information available (required by node)
node: /usr/lib/libstdc++.so.6: no version information available (required by node)
node: /usr/lib/libstdc++.so.6: no version information available (required by node)
node: /usr/lib/libstdc++.so.6: no version information available (required by node)
node: /usr/lib/libstdc++.so.6: no version information available (required by node)
Welcome to Node.js v14.16.1.
Type ".help" for more information.
> console.log('it seems ok?')
it seems ok? |
Hi! We're switching from nvm to volta in our team to better handle versions or both node and npm for all developers. It's been a great experience so far, but I as the initiator and our devops engineer were talking about using it in our CI pipelines. That would make it much easier to upgrade node and keep the version of npm we want in those environments. I tried the approach @markhughes took, but not all npm packages seem to install OK for me this way. Is this being considered? If so, is there a possible timeline when this would be possible? Cheers and keep up the great work 👍 |
@gligoran We haven't really investigated too much what it would take to create a statically-linked binary. Given the work that was done up-thread, it seems like it may be fairly straightforward to get Volta itself working in that environment. We'd be happy to accept a PR to add that to our CI / Release matrix so that there are binaries available. One other concern I have is that you're having issues with |
I think you might be right. I'm not too knowledgeable about |
Honestly, after weeks of research it was just easier to not use Alpine. Sure, it's a lot smaller which is great. However lots of things just.. break. I don't recall what, but I ran into further issues with node-gyp stuff. The hassle was just not worth it. I started again with a Debian image and was all set in 15 minutes. |
I'd recommend using the GLibC variant. |
I tried adding volta to a container and when I try to execute it, I get:
bash: /root/.volta/volta: No such file or directory
Here is the Dockerfile I'm using:
The text was updated successfully, but these errors were encountered: