question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gzip compression unavailable within Docker (and no zstd)

See original GitHub issue

Hi, I’m pretty new to use node-rdkafka.

When I run my node-rdkafka app within a Docker container I get the following output from

console.log(Kafka.features);

Output:

[ 'snappy', 'sasl', 'regex', 'lz4', 'sasl_plain', 'plugins' ]

The only one compression method available is lz4.

When I run the same app into my machine I get the output:

[ 'gzip', 'snappy', 'sasl', 'regex', 'lz4', 'sasl_gssapi', 'sasl_plain', 'plugins' ]

It seems that the library compilation within Docker fails to add the gzip compression. The compilation output is pretty long so I prefer to link the Dockerfile.

Aside: no zstd library available in both cases.

What’s going on? Let me know if further information are needed.

Environment Information

  • OS: Mac
  • Node Version: 12
  • NPM Version [e.g. 5.4.2]: 6.14.4
  • C++ Toolchain: g++
  • node-rdkafka version: 2.8.1

Steps to Reproduce

Run this project https://github.com/ccarcaci/spike-node-kafka

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sam-githubcommented, Apr 30, 2020

Why are you using node-slim? The main thing that makes it slim is not having the build tools, which you add back in.

Consider a multi-stage build, something like:

# Install the app dependencies in a full Node docker image
FROM node:12

# librdkafka builds against libssl-dev
RUN apt-get update && apt-get install -y libssl-dev && apt-get clean

WORKDIR /project
RUN npm install --production

# Copy the dependencies into a slim Node docker image
FROM node:12-slim

# librdkafka links against libssl
RUN apt-get update && apt-get install -y libssl1.1 && apt-get clean

COPY --chown=node:node --from=0 /project /project  # or whatever is right for you

If that doesn’t get you more features, you have to find and add the relevant -dev packages to the build image, libsasl for example (I haven’t checked).

0reactions
stale[bot]commented, Aug 1, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Evaluating Compression with Pareto, Docker and Gnuplot
TLDR: If you have a lot of data to compress, it's worth evaluating different compression programs and settings on a subset of your...
Read more >
Giuseppe Scrivano on Twitter: "My patch for adding zstd ...
My patch for adding zstd support to Moby was finally merged! Now we can move away from gzip compressed container images. 11:22 AM...
Read more >
Nginx gzip compression not working despite following official ...
So I go and test from a linux VM using curl to attempt to fetch the file with gzip and see what it...
Read more >
How to install and use ZSTD compression tool on Linux
In this tutorial, we show the step by step instructions to install and use the Zstandard (zstd) compression tool on Linux, with command...
Read more >
Compression and Decompression | NGINX Plus
Some clients do not support responses with the gzip encoding method. At the same time, it might be desirable to store compressed data,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found