-
Notifications
You must be signed in to change notification settings - Fork 46
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
Dynamic (native) module loading not supported #3
Comments
Yes, It may be possible to use the |
@alanpearce I'm just curious: Are you using native modules that you had to write yourself, or is it something leftover from the dark ages of node before we had built-ins? I'm just wondering what in node (other than native desktop apps) still need native modules and why (because some of those problems I'm interested in tackling). |
It seems to be the bcrypt module, although there could be others. We haven't written anything native ourselves. |
A lot of npm modules uses native bindings. @alanpearce How much is "rather small" for you? I've done "rather small" images: https://hub.docker.com/r/dzek69/nodemin/tags How these are built? I'm taking node alpine official image and simply removing everything that's not needed (npm and yarn for example). System tools are left untouched (so wget and all these are working, busybox, which provides these is 8MB big IIRC). After removal image is squashed into single layer. See here for Dockerfile: https://github.com/dzek69/docker-node-minimal/blob/master/build/Dockerfile.node - and here: https://github.com/dzek69/docker-node-minimal for more information. Building images by yourself is far from perfect (I'm not good at bash scripts), but it works. I'm using these on production without any issue. Sorry for kind of advertisement. I made this project when I discovered |
@dzek69 Those images are pretty cool. We would like to avoid having any kind of tools in the image though. It looks as though there's a pending distroless/node PR which might work for us. Thanks for the tips though |
This should be fixed with 1da3813. I've re-pushed the On my side, I've tested it successfully for Thanks for your patience! |
Thanks for the new feature! Would it be possible to backport it to node 10? We'd like to stick to LTS versions on production. Node 12 will enter LTS at the end of October. I tried building the image locally and it seems to have worked |
@alanpearce yes, all the documented images have been updated already, so 10, 10.16, 10.16.0 should have support for native modules. |
Oh, great, thanks! I must've misunderstood the previous message. 👌 |
After trying to use these modules, it seems that they cannot load dynamic modules like bcrypt, for example.
I found this issue smebberson/docker-alpine#52 which seems to highlight the
--fully-static
compilation flag as being responsible for this and noticed that it is indeed passed here.Would it be possible to get these images to work in a way that supports dynamic module loading, but is still rather small?
The text was updated successfully, but these errors were encountered: