node-libxml-xsd icon indicating copy to clipboard operation
node-libxml-xsd copied to clipboard

Binding error in Docker Alpine

Open JbIPS opened this issue 6 years ago • 3 comments

Hello,

I'm using libxml through samlify and I have some problem when using my app in a Docker Alpine container (base on the official node one):

> [email protected] start /opt/app
> node -r make-promises-safe lib/index.js

/opt/app/node_modules/bindings/bindings.js:88
        throw e
        ^

Error: Error loading shared library xmljs.node: No such file or directory (needed by /opt/app/node_modules/libxml-xsd/build/Release/node-libxml-xsd.node)
    at Object.Module._extensions..node (module.js:689:18)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at bindings (/opt/app/node_modules/bindings/bindings.js:81:44)
    at Object.<anonymous> (/opt/app/node_modules/libxml-xsd/index.js:8:34)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)

I tried to build and rebuild with gyp, I checked the content of node_modules/libxmljs-mt/build/Release/, xmljs.node is there (in obj.target too) and it works perfectly outside of Docker.

Do you have any clues on why this happens once in a container?

Thank you

JbIPS avatar Apr 10 '18 17:04 JbIPS

Hello,

Unfortunately I don't have the time to actively maintain this project and I don't remember encountering this problem. However I accept pull requests, in case you find a fix...

Sorry about that.

albanm avatar Apr 10 '18 19:04 albanm

Actually I took the issue to the node:alpine guys and it looks like the problem is with glibc/musl.

A solution was implemented by NodeSass here. Could you lead me to where I should operate some similar changes?

Thanks a lot

JbIPS avatar Apr 11 '18 20:04 JbIPS

It seems that the fix is in a part of the code whose tasks are delegated to https://github.com/TooTallNate/node-bindings in our case.

You could try updating this dependency.

albanm avatar Apr 12 '18 06:04 albanm