Docker file for node:8-alpine base is available here. Please provide working Docker file for node:12.4.0-alpine base image.
This would be great +1
Or even Node 10.
node-rdkafka currently seems to work only up to Node 8...
@IdanAdar why you say it works only up to node8? I am starting a development with it right now and seems to work fine, except for few already open issues
This is a known issue and not really fixable via node-rdkafka. The librdkafka library compiles against an older version of libssl and later versions of Node (10, 12) use a later, incompatible, version of libssl. The only work around seems to be using libressl, which works on OSX, but I've been unable to get it to work on Linux.
I'm sure the project would love a PR with this work...
@jondeandres are you using OSX for dev? You might be surprised when you containerize your app.
I am not, but I am not using any node image but compiling node by myself
@IdanAdar @rclayton-the-terrible it works for me with Node 10 on Ubuntu 18.04
@IdanAdar @rclayton-the-terrible it works for me with Node 10 on Ubuntu 18.04
How did you do it? Did you compile librdkafka with a newer version of libssl?
@IdanAdar @rclayton-the-terrible it works for me with Node 10 on Ubuntu 18.04
How did you do it? Did you compile
librdkafkawith a newer version oflibssl?
I removed libssl-dev on Ubuntu before installing node-rdkafka by npm
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Was anyone able to get this to work with Node 12? @rclayton-the-terrible
@mariovinay-nutanix I tried Node 12, but was unsuccessful. We are using Node 10 now without issue.
FROM node:12-alpine
RUN apk --no-cache add \
bash \
g++ \
ca-certificates \
lz4-dev \
musl-dev \
cyrus-sasl-dev \
openssl-dev \
make \
python
WORKDIR /src
RUN npm i node-rdkafka
RUN node -v
The solution from @iradul works fine, even on node 14, but keep in mind it will explode the image size (+400MB). Do it only in the intermediate container, then just copy node_modules folder to the destination image. More over remove these items, they are about 200MB, and you don't really need it:
node_modules/node-rdkafka/deps
node_modules/node-rdkafka/build/deps/*.a
You basically need 2 libraries:
librdkafka++.so
librdkafka.so
They can actually be installed from standard alpine repos.
Most helpful comment
The solution from @iradul works fine, even on node 14, but keep in mind it will explode the image size (+400MB). Do it only in the intermediate container, then just copy node_modules folder to the destination image. More over remove these items, they are about 200MB, and you don't really need it:
You basically need 2 libraries:
They can actually be installed from standard alpine repos.