confluentinc / confluent-kafka-dotnet

Confluent's Apache Kafka .NET client
https://github.com/confluentinc/confluent-kafka-dotnet/wiki
Apache License 2.0
52 stars 857 forks source link

The proper way to use alpine-librdkafka.so #1423

Open dmtrrk opened 3 years ago

dmtrrk commented 3 years ago

Description

I'm using Alpine v3.10 based docker image and Kafka client v1.2.2 Also I have to use glibc-2.32-r0.apk package in order to use GCP SDK (gRPC lib inside) in Alpine.

So whenever I use glibc-2.32-r0 I can run GCP code. But whenever I try to use Kafka client with glibc-2.32-r0 it fails with segfault.

In my output folder I have:

alpine-librdkafka.so
centos7-librdkafka.so
debian9-librdkafka.so
librdkafka.so

Do I need to do anything with these files or will it configure references automatically (e.g. rename alpine-librdkafka.so to librdkafka.so)

How to reproduce

  1. Use docker image based on Alpine
  2. copy a simple app with Kafka dependency
  3. install apk
    wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
    wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk
    apk add glibc-2.32-r0.apk

Checklist

Please provide the following information:

edenhill commented 3 years ago

Are you building your app with -tags musl? We have not done any testing with glibc on alpine, only with musl.

dmtrrk commented 3 years ago

I'm using a such build command:

RUN dotnet publish -c Release -o ${buildDir} --self-contained=false -r linux-musl-x64 --no-restore ${projectDirectory}

would you mind to describe a bit more detailed what do you mean by that tag param?

edenhill commented 3 years ago

Oh sorry, I mistook this for the Go client, my bad.

edenhill commented 3 years ago

But even for the .NET client we havent tested using glibc on Alpine, so you are in uncharted territory.

marcelczok-epm commented 3 years ago

I have the same situation, always generating these 4 files. I am also using linux-musl-x64. I am using Confluent.Kafka 1.5.1 :(