Skip to content

M1 Mac - confluent-kafka librdkafka error message when building Docker image #1405

Closed
@yusufosman

Description

@yusufosman

Description

I'm getting the below error whenever I try to pip install confluent-kafka within my Dockerfile and I build that Dockerfile using python:3.10-slim-bullseye as my base image.

error: #error "confluent-kafka-python requires librdkafka v1.9.0 or later. Install the latest version of librdkafka from the Confluent repositories, see http://docs.confluent.io/current/installation.html"

Please note that I have already installed librdkafka-dev as part of my Dockerfile, and this has been working fine for months until recently, but now it seems to be complaining that I don't have librdkafka and I'm not sure why.

How to reproduce

Dockerfile

FROM public.ecr.aws/docker/library/python:3.10-slim-bullseye

# hadolint ignore=DL3008
RUN apt-get update && apt-get install --no-install-recommends -y \
  gcc \
  librdkafka-dev \
  build-essential \
  && rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir --upgrade pip==22.1.2 && pip install confluent-kafka

run docker build - < Dockerfile against the above Docker file and you will see the error I provided.

The only way I can successfully build the image is via the following command: docker build --platform linux/amd64 - < Dockerfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionA question about how to use or about expected behavior of the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions