【发布时间】:2022-06-13 11:25:40
【问题描述】:
我在我的项目中使用 confluent-kafka Python 客户端。我正在尝试使用此客户端创建 Docker 映像。
我面临以下错误:-
#11 8.015 [pipenv.exceptions.InstallError]: In file included from /tmp/pip-install-so_whhii/confluent-kafka_9d9553bf46cf489bb25fcb2ac7698747/src/confluent_kafka/src/Admin.c:17:
#11 8.015 [pipenv.exceptions.InstallError]: /tmp/pip-install-so_whhii/confluent-kafka_9d9553bf46cf489bb25fcb2ac7698747/src/confluent_kafka/src/confluent_kafka.h:23:10: fatal error: librdkafka/rdkafka.h: No such file or directory
#11 8.015 [pipenv.exceptions.InstallError]: 23 | #include <librdkafka/rdkafka.h>
#11 8.015 [pipenv.exceptions.InstallError]: | ^~~~~~~~~~~~~~~~~~~~~~
#11 8.015 [pipenv.exceptions.InstallError]: compilation terminated.
#11 8.015 [pipenv.exceptions.InstallError]: error: command '/usr/bin/gcc' failed with exit code 1
#11 8.016 [pipenv.exceptions.InstallError]: [end of output]
根据我的搜索,它与 Apple M1 build for librdkafka 有关。
【问题讨论】:
-
请edit 发布您的Dockerfile 的相关部分。请包含基本映像
FROM,以及您尝试安装的任何其他库/包,包括 confluent-kafka。 -
如果您尝试构建 ARM 映像,那么是的,您可能不得不改用 kafka-python
标签: python docker apache-kafka librdkafka confluent-kafka-python