Blizzard / Blizzard/node-rdkafka

Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (....)

Open
#992 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.2k
Forks
403
PR merge metrics
No merged PRs in 30d

Description

**Environment Information**
- OS [e.g. Ubuntu 22.04.1 LTS]:
- Node Version [e.g. 14]:
- NPM Version [e.g. 6]:
- C++ Toolchain [e.g. Visual Studio, llvm, g++]:
- node-rdkafka version [e.g. 2.14.2]:

I'm following the example of the docker-alpine.md component to upload the node container, but I get an error loading shared library ld-linux-x86-64.so.2.
The error appears because I export the library in my node application

### Dockerfile
FROM node:14-alpine

RUN apk --no-cache add \
bash \
g++ \
ca-certificates \
lz4-dev \
musl-dev \
cyrus-sasl-dev \
openssl-dev \
make \
python3

RUN apk add --no-cache --virtual .build-deps gcc zlib-dev libc-dev bsd-compat-headers py-setuptools bash

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install --silent && npm cache clean --force

COPY . .

EXPOSE 3030

CMD ["npm", "run", "dev"]

---

### Following error
```bash
Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/src/app/node_modules/node-rdkafka/build/Release/../deps/librdkafka.so.1)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at bindings (/usr/src/app/node_modules/node-rdkafka/node_modules/bindings/bindings.js:112:48)
at Object. (/usr/src/app/node_modules/node-rdkafka/librdkafka.js:10:32)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32) {
code: 'ERR_DLOPEN_FAILED'
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.