Sign inSign up

kaustubh456/kafka-armv7

By kaustubh456

•Updated about 1 month ago

Lightweight Apache Kafka (KRaft mode) optimized for 32-bit ARM (arm/v7) devices like Raspberry Pi.

Image
Internet of things
Developer tools
Databases & storage
1

80

kaustubh456/kafka-armv7 repository overview

⁠Apache Kafka (KRaft Mode) for 32-bit ARM (ARMv7)

A lightweight, standalone Apache Kafka container image built natively for 32-bit ARM (linux/arm/v7) Single Board Computers (such as Raspberry Pi 2, Raspberry Pi 3 running 32-bit OS, DietPi, Armbian).

⁠Features

  • No ZooKeeper Needed: Runs in modern KRaft mode (single-node controller + broker).
  • True ARMv7 Support: Built on eclipse-temurin:17-jre-jammy—one of the few modern OpenJDK 17 runtimes that still maintains official 32-bit ARM binaries.
  • Low-Memory Tuned: Designed to run comfortably on devices with as little as 1 GB RAM.
  • Auto-Initialization: Automatically creates a cluster ID and formats KRaft metadata storage on the first boot.
  • Dual Listeners:
    • 9092: Internal container-to-container listener (PLAINTEXT).
    • 9094: External LAN/host listener (EXTERNAL).

⁠Quick Start

⁠Run with Docker CLI
docker run -d \
  --name kafka \
  -p 9092:9092 \
  -p 9094:9094 \
  -e KAFKA_HEAP_OPTS="-Xms160m -Xmx160m" \
  -e KAFKA_EXTERNAL_HOST="192.168.1.100" \
  -v kafka-data:/var/lib/kafka/data \
  kaustubh456/kafka-armv7:latest
services:
  kafka:
    image: kaustubh456/kafka-armv7:latest
    container_name: kafka
    restart: unless-stopped
    ports:
      - "9092:9092"   # Internal / local port
      - "9094:9094"   # External LAN port
    environment:
      # Critical for 1GB RAM SBCs: prevent default 1GB JVM heap allocation
      KAFKA_HEAP_OPTS: "-Xms160m -Xmx160m"
      # Set to your device's LAN IP for remote consumers/producers
      KAFKA_EXTERNAL_HOST: "192.168.1.109"
    mem_limit: 256m
    memswap_limit: 384m
    volumes:
      - kafka-data:/var/lib/kafka/data
    healthcheck:
      test: ["CMD", "nc", "-z", "localhost", "9092"]
      interval: 15s
      timeout: 5s
      retries: 10
      start_period: 60s

volumes:
  kafka-data:

⁠Configuration & Environment Variables

VariableDefaultDescription
KAFKA_EXTERNAL_HOSTlocalhostThe LAN IP address or hostname that external network clients use to connect to port 9094.
KAFKA_HEAP_OPTS-Xms1G -Xmx1GJVM memory allocation. Set to -Xms160m -Xmx160m on 1GB RAM devices.

⁠Ports & Volumes

⁠Exposed Ports
  • 9092 — Internal listener (PLAINTEXT://kafka:9092)
  • 9093 — KRaft controller listener (CONTROLLER)
  • 9094 — External network listener (EXTERNAL://${KAFKA_EXTERNAL_HOST}:9094)
⁠Volume Mount
  • /var/lib/kafka/data — Persistent storage for Kafka commit logs and KRaft cluster metadata.

⁠Verification & Testing

Once the container is running, verify it by creating a test topic and sending a message using Kafka's built-in CLI:

# 1. Create a test topic
docker exec -it kafka /opt/kafka/bin/kafka-topics.sh \
  --create --topic test-topic --bootstrap-server localhost:9092

# 2. Produce a message (type a message and hit Enter, then Ctrl+C to exit)
docker exec -it kafka /opt/kafka/bin/kafka-console-producer.sh \
  --topic test-topic --bootstrap-server localhost:9092

# 3. Consume the message
docker exec -it kafka /opt/kafka/bin/kafka-console-consumer.sh \
  --topic test-topic --from-beginning --bootstrap-server localhost:9092

Tag summary

Content type

Image

Digest

sha256:538e737a1…

Size

343.2 MB

Last updated

about 1 month ago

docker pull kaustubh456/kafka-armv7