-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Node-gyp compilation fails in node alpine image for docker #1855
Comments
These are all just compile warnings, not errors, at the bottom you have a successful bcrypt_lib.node that can be loaded as an addon. If you need the warnings to go away then you'll have to take that up with the node-bcrypt folks (or redirect the output to /dev/null if you really don't want to see it). |
Thanks for the reply @rvagg however bcrypt import doesnt work in koa.js even after the successful bcrypt_lib.node compilation. For the time I am using an all javascript version of bcrypt with zero dependancies called bcryptjs to get past the issue. |
so, try running your container with |
@rvagg I have given the commands below and they dont give any error:
and
However when the actual node app runs ( which by the way is in typescript) the follwing shows up:
I do additionally install "@types/bcrypt" for type definitions as dev dependencies. |
Yeah, that is a bit weird. Is it possible that you have multiple versions of |
So still on square one. |
Unfortunately version isn't the only compatibility vector. Alpine uses musl libc, not glibc. Presumably you're using an official Alpine Docker image (from nodejs/docker-node, published as the official node images). They are using proper musl builds, so glibc isn't involved at all. But it's possible to install glibc and compile against it, or use standard Linux x64 binaries on Alpine that are compiled against glibc. If you compile an addon with a glibc Is it possible another https://github.com/remy/nodemon#default-executables nodemon has the ability to manually specify the executable to be used. I also notice in https://github.com/remy/nodemon/blob/master/lib/config/defaults.js it has a |
Ping @nodejs/docker - this might be interesting for you and maybe someone's dealt with this before and has a better answer than me. Summary: compiling an addon inside a container isn't being loaded when the app is started |
I will take a look! I seem to remember an issue with alpine and bcrypt though. |
Closing due to inactivity, can reopen if necessary. |
I'm running into the same issue while trying to build an image with https://github.com/laverdet/isolated-vm |
I'm running into the same issue for npm dependencies that rely on node-gyp. Here's my current Dockerfile (I've configured it many different ways to no avail):
|
@DanielCurtis Try using a specific Node.js version. I've been able to resolve it with:
|
There seems to be an issue with Node 15: #2245 Edit: Using |
Hi,
My bcrypt module install fails in docker.
I am using docker for a node application the following is my docker file:
I have followed instructions in some other threads, mainly this one:
nodejs/docker-node#282
However I get a huge dump as soon as source compilation starts during docker-compose up.
Below is the dump for reference:
I would appreciate any help.
The text was updated successfully, but these errors were encountered: