-
Notifications
You must be signed in to change notification settings - Fork 187
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
alpine-nodejs: Dynamic loading not supported #52
Comments
I'll look to remove it, I'll work up a |
I'm not too familiar with static vs dynamic compiling. Dynamic may affect performance a bit, perhaps there is a benchmark/profiling done for static vs dynamic compiled nodejs? I came across some advantages/disadvantages for dynamic linking here, might be worth a little description/notice on readme of the difference for developers that might not be aware of the difference. |
Yeah, to be honest, neither am I. I'm not sure if there is a benchmark available, I can't seem to find one. From reading that page on the Node.js wiki, it looks like it is a non-standard thing and might not allow all Node.js modules on NPM to work. If this test goes well, I think I'll remove the tag permanently so that these images work in more situations. Just doing a test build now :) |
@polarathene, sorry it took a while, but you should be able to use the Let me know how you get on. |
@smebberson Seems to be working great now :) Thanks! A similar alpine/node image is Will the other images such as consul and nginx combinations get this change as well? |
@polarathene, I'm glad it works now. I'm not sure if I'll add this as standard or as an optional tag. I'll definitely add some information to the README. Other images such as the nginx combinations and Consul will follow suit. I was planning on deprecating the nginx-nodejs combo - you were planning on using that? I'll reopen this to track it until this change is made permanent. @matthewvalimaki, @ncornag any input on this? |
I'm more than likely going to go with separate nginx and nodejs images, seems the better approach right? The extra combination rather than an example of the two images in use together adds to confusion a bit on where to start(new to docker). As a new user I'm keeping it simple with just a nodejs image, will probably add an nginx one in next, not sure if I should go straight to the consul variants or get it working without consul first. I haven't used consul yet either but been eager to from what I've read. |
@polarathene, yeah, I think having Nginx running in it's own container even if just to proxy requests is a better setup. The examples in this repository show you how to do this easily too. While going straight to the Consul variants adds some extra overhead to your learning, and prototyping, ultimately, it's the best approach. Service discovery with Docker gets pretty tricky pretty quickly without it. Good luck ;) |
@smebberson I only use consul based images. Nginx and node are running in
|
@matthewvalimak, sorry, I think I might have miscommunicated to you. What are your thoughts on the static issue? Are you in favour of keeping the images fully static, or moving to a more standard non-static setup is okay with you? |
@smebberson oh haha no problem. I'm glad I gave my thoughts though :) I do not have an opinion on this unfortunately.
|
I do plan to keep using nodejs and nginx in the same container, simply because I like having my whole app bundled (especially when serving static files) rather than separated. I like the idea of separation of concern, but the concern here being "serving my application" I don't see the point in splitting things further. I particularly want to avoid situations where a container was updated and not the other one -- thus simplifying update scenarios. |
sorry, realized I was a bit out of topic there. |
@polarathene, I'm moving away from |
@smebberson I am not able to provide a Dockerfile for the specific project I was working with at present. However I've recently come back to working with Docker and Alpine on something similar. The previous project used node-openzwave-shared, I'm now trying to get node-red with the package node-red-contrib-openzwave(depends on `node-openzwave-shared) to build with Alpine. I'll be happy to share the Dockerfile for that once that successfully compiles :) Present issue is with node-gyp not being happy about permissions, I'm not sure what best practice for installing packages with npm is, I believe the issue is due to using There was another issue with installing I've also read about suggestions that native dependencies should be compiled in a build container and then the compiled dependency moved into the production container, others just do cleanup and remove the packages needed to compile the dependencies. The latter method I've also read if not done right in the Dockerfile affects Image size due to split layers? |
I have the following Dockerfile currently compiling:
I'll update that tomorrow to compile from the github project rather than local which should give you a test case? |
@smebberson I've been playing around with the Dockerfile for a bit. It works fine with both
This output when it fails to load the serial and openzwave plugins for node-red:
This is output with no problems on
There was a bunch of JS stack trace and a warning, but I believe that's specific to npm package, nothing wrong with your image :) |
@polarathene, awesome. I'm glad it's all working with the latest setup. I'll move the Consul builds away from static too now. Thanks for the Dockerfiles, I'll keep those as test cases. |
In c873e62 you removed the I assume the change was meant to be propagated to the |
I'm compiling a native library for OpenZWave and using a node package
node-openzwave-shared
. The source seems to compile fine but when using the node package it runsprocess.dlopen()
and throws an errorDynamic loading not supported
. This is apparently due to using a static binary for node.js?(See this comment)The suggestion at the linked comment is to remove
--fully-static
flag. I'm currently usingalpine-nodejs
but would like to move to using theconsul
variants at a later stage, any chance of removing the flag or having a variant to allow this?The issue seems to be described on the nodejs wiki too.
The text was updated successfully, but these errors were encountered: