kafka-docker icon indicating copy to clipboard operation
kafka-docker copied to clipboard

Support for ARM64

Open gmussi opened this issue 5 years ago • 17 comments

Hi all,

With better ARM64 devices being released in increased speed, it is getting easier and easier to setup a local cluster for testing purposes (and even production of smaller scale cases).

The current image derives from openjdk:8u212-jre-alpine which is available in the ARM64 architecture, so it should be fairly easy (I assume) to release an image for that architecture too. The Zookeeper image (also from wurstmeister) does this.

I have tried many docker images of kafka on arm (which all have 0 documentation) but so far couldn't make any of them work on my swarm cluster. I am running Kali 64bit OS on a cluster of RaspberryPi4 4gbs. Would be happy to receive any pointers from you.

gmussi avatar May 30 '20 18:05 gmussi

For anyone else who might need this: I cloned the repo on my OS (Kali, 64bit ARM) and built it there. Worked out of the box. So I think only a multi-arch release is missing in this repo.

gmussi avatar May 30 '20 19:05 gmussi

Last I heard, openjdk already pushes multi-arch images

OneCricketeer avatar Jun 17 '20 11:06 OneCricketeer

the only problem i see is, the installation of glibc which is not aarch64 i guess.

langerma avatar Aug 07 '20 10:08 langerma

Can confirm it's working without problems! I was able to get it running on a raspberry pi and had to build the image there, thank you.

yalopov avatar Mar 27 '21 19:03 yalopov

@yalopov I see this ticket is still opened, can you share where can I get the official build support for AMR?

vumdao avatar May 26 '21 15:05 vumdao

As far as I know, wurstmeister/kafka-docker is not generating arm builds, I had to build it myself on a raspberry pi (any aarch64 environment will do) and published it to dockerhub (nyadesu/kafka-docker)

yalopov avatar May 26 '21 15:05 yalopov

@yalopov thanks for your help, so in order to build kafka for ARM, we just need to run docker build on any aarch64 env?

vumdao avatar May 26 '21 16:05 vumdao

@yalopov thanks for your help, so in order to build kafka for ARM, we just need to run docker build on any aarch64 env?

Yes! In fact what some other projects are doing to handle this is to setup an aarch64 env with QEMU and building it there

yalopov avatar May 26 '21 16:05 yalopov

@yalopov, thank you very much, the image you provide works for me too!

Wondering why wurstmeister/kafka-docker does not internally support ARM64 image by using a multi-arch parent images and multi-arch docker builds, using docker buildx. This solution would be more maintainable, because every version of this image will become available on all possible architectures.

sermojohn avatar Sep 13 '21 12:09 sermojohn

So, I've tried to clone and build it with

docker build . or docker build --platform linux/arm64 . or docker build --platform linux/arm64/v8 .

which resulted in

Step 11/14 : RUN apk add --no-cache bash curl jq docker && chmod a+x /tmp/*.sh && mv /tmp/start-kafka.sh /tmp/broker-list.sh /tmp/create-topics.sh /tmp/versions.sh /usr/bin && sync && /tmp/download-kafka.sh && tar xfz /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -C /opt && rm /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz && ln -s /opt/kafka_${SCALA_VERSION}-${KAFKA_VERSION} ${KAFKA_HOME} && rm /tmp/* && wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk && apk add --no-cache --allow-untrusted glibc-${GLIBC_VERSION}.apk && rm glibc-${GLIBC_VERSION}.apk ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ---> Running in 38ccc2ea820d standard_init_linux.go:228: exec user process caused: exec format error

every single time.

Is there anything I did wrong?

financelurker avatar Sep 28 '21 08:09 financelurker

the glibc version (https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk) is still amd64 i guess you must build it yourself.

langerma avatar Sep 28 '21 13:09 langerma

It looks as though an attempt was made to create arm64 images but those images are still running x64 JRE. I am referring to this commit: https://github.com/wurstmeister/kafka-docker/commit/c4e8f17fc9bbfe713b31bd9969babbb59523147b

docker run wurstmeister/kafka:2.13-2.8.1 arch
Unable to find image 'wurstmeister/kafka:2.13-2.8.1' locally
2.13-2.8.1: Pulling from wurstmeister/kafka
Digest: sha256:4916aa312512d255a6d82bed2dc5fbee29df717fd9efbdfd673fc81c6ce03a5f
Status: Downloaded newer image for wurstmeister/kafka:2.13-2.8.1
x86_64

NikolayMetchev avatar Jan 19 '22 15:01 NikolayMetchev

Is there any developments on this? It's a bit annoying that based on the Docker Hub ARM64 is supported but those images are still have AMD64 binaries. The Dockerfile contains a step which fetches an AMD64 only glibc APK. I think until that is there then the image won't really usable on ARM64 which is sad because this blocks our migration to AWS Graviton instances.

akunszt avatar Mar 25 '22 10:03 akunszt

I also had problems running the docker image on raspberry pi. Also building the Dockerfile was not possible. I have changed following in the Dockerfile locally and build it on raspberry Pi 4B:

Changed version to 18 -> supports ARM FROM azul/zulu-openjdk-alpine:18

Changed glibc_version to 2.35 ARG glibc_version=2.35-r0

I don't know if there are arising any new issues, but with the new build i finally got my project running.

https://hub.docker.com/r/ricktauss/kafka

Dockerfile.txt

ricktauss avatar Apr 30 '22 10:04 ricktauss

Hello everyone, check if this helps https://github.com/arm64-compat/confluent-platform/pkgs/container/confluentinc%2Fcp-kafka

These are not wurstmeister/kafka-docker images but confluent ones. I usually run arm64-compat project to provide compatibility for the popular images which doesn't currently have an official arm64 support.

I would try to port wurstmeister/kafka-docker images if there is enough support, meanwhile I have been using confluent images on my local and it is working perfectly.

These images are built on arm64 machine and not using qemu simulations, so won't be having any downside in performance on local.

anuragagarwal561994 avatar May 11 '22 00:05 anuragagarwal561994

Having wurstmeister/kafka-docker would be great. I can help with them and test. The confluent images don't support everything that these images do. For example https://github.com/confluentinc/kafka-images/issues/70 is really nice for us as we manage kafka topics outside of our applications.

adamdecaf avatar Sep 16 '22 15:09 adamdecaf

I also had problems running the docker image on raspberry pi. Also building the Dockerfile was not possible. I have changed following in the Dockerfile locally and build it on raspberry Pi 4B:

Changed version to 18 -> supports ARM FROM azul/zulu-openjdk-alpine:18

Changed glibc_version to 2.35 ARG glibc_version=2.35-r0

I don't know if there are arising any new issues, but with the new build i finally got my project running.

https://hub.docker.com/r/ricktauss/kafka

Dockerfile.txt

this glibc_"version".apk support aarch64/amd64 at same time? @ricktauss

update: It seems like glibc_"version".apk does not support aarch64, https://github.com/SonarSource/docker-sonarqube/issues/526 we can delete glibc related code because kafka doesn't need it to run

lazywhite avatar Oct 28 '22 07:10 lazywhite