Open lukarmar opened 1 year ago
For me this Dockerfile works well:
FROM node:14-alpine
# Alpine and node-rdkafka
# See https://github.com/Blizzard/node-rdkafka/blob/master/examples/docker-alpine.md
RUN apk --no-cache add \
bash \
g++ \
make \
python3
RUN apk --no-cache add \
librdkafka=1.9.2-r0 \
librdkafka-dev=1.9.2-r0
ARG BUILD_LIBRDKAFKA=0
RUN npm i node-rdkafka@2.14.6
# We should remove deps because we use apk pkges
RUN rm -rf /node_modules/node-rdkafka/deps
Environment Information
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