Skip to content
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

Module doesn't work on Docker #8

Closed
richthegeek opened this issue Jul 13, 2017 · 6 comments
Closed

Module doesn't work on Docker #8

richthegeek opened this issue Jul 13, 2017 · 6 comments

Comments

@richthegeek
Copy link

When running the module in a Docker container using this config:

FROM mhart/alpine-node:8.1.4

RUN apk update
RUN apk add --no-cache git openssh python make g++ libc6-compat

# copy project files
COPY . /src

# install node_modules
RUN cd /src; npm install

# run
CMD ["node", "/src/app/app.js"]
EXPOSE 3002

I get this error:

/src/node_modules/bindings/bindings.js:83
        throw e
        ^

Error: Error relocating /src/node_modules/detect-character-encoding/build/Release/icuWrapper.node: ucnv_close_58: symbol not found
    at Object.Module._extensions..node (module.js:598:18)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at bindings (/src/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/src/node_modules/detect-character-encoding/index.js:3:37)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)

It works locally (OSX) and on Travis (linux i think), and I have tried it with versions of node from 0.10.48 all the way up to 8.1.4. Are there unlisted dependencies that you can think of?

@richthegeek
Copy link
Author

Seems like this is a problem with Alpine which uses musl-libc instead of glibc etc.

@sonicdoe
Copy link
Owner

Exactly. If you use the official Docker image for Node.js detect-character-encoding should work fine. I’ll try to include support for Alpine Linux in a future release.

@sonicdoe
Copy link
Owner

v0.5.0 now supports Alpine Linux.

@richthegeek
Copy link
Author

Thanks!

@nuest
Copy link

nuest commented Aug 31, 2017

Just wanted to note here that using alpine:3.6 and installing nodejs myself (6.x) as base image did not work for me, but using node:8-alpine did.

Thanks for a great package!

@sonicdoe
Copy link
Owner

sonicdoe commented Sep 3, 2017

@nuest Thanks for the kind words 🙂 I was able to reproduce the issue with the node:6-alpine image. However, I’m not sure if I’ll be able to fix this in the near future so I have created a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants