Skip to content

Docker Kafka image for the Confluent Open Source Platform using Oracle JDK

License

Notifications You must be signed in to change notification settings

MihaiBogdanEugen/docker-confluent-kafka

Repository files navigation

Supported tags and respective Dockerfile links:

All tag names follow the naming convention of the Confluent Open Source Platform

Summary:

  • Debian "slim" image variant
  • Oracle JDK 8u152 addded, without MissionControl, VisualVM, JavaFX, ReadMe files, source archives, etc.
  • Oracle Java Cryptography Extension added
  • Python 2.7.9-1 & pip 9.0.1 added
  • SHA 256 sum checks for all downloads
  • JAVA_HOME environment variable set up
  • Utility scripts added:
  • Apache Kafka added:
    • version 0.10.2.1 in 3.2.2
    • version 0.11.0.0 in 3.3.0
    • version 0.11.0.1 in 3.3.1 and latest

Details:

This image was created with the sole purpose of offering the Confluent Open Source Platform running on top of Oracle JDK. Therefore, it follows the same structure as the one from the original repository. More precisely:

  • tag 3.2.2 follows branch 3.2.x, and
  • tags 3.3.0, 3.3.1 andlatest follow branch 3.3.x

Apart of the base image (mbe1224/confluent-base), it has Apache Kafka added on top of it, installed using the following Confluent Debian package:

  • confluent-kafka-2.11

Usage:

Build the image

docker build -t mbe1224/confluent-kafka ./3.3.1/

Run the container

docker run -d \
    --net=host \
    --name=kafka \
    -e KAFKA_ZOOKEEPER_CONNECT=localhost:12181 \
    -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:19092 \
    -e KAFKA_BROKER_ID=1 \
    -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 \
    mbe1224/confluent-kafka

Configuration:

One can configure a Kafka instance using environment variables. All Configuration Options (Broker Configs and Topic-level Configs) from the official documentation can be used as long as the following naming rules are followed:

  • upper caps
  • "." replaced with "_"
  • snake case instead of pascal case
  • "KAFKA_" prefix

For example, in order to set the replication factor for the offsets topic, one has to modifiy the "offsets.topic.replication.factor" property, which is translated in the "KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR" environment variable.

Kubernetes:

For Kubernetes deployments using StatefulSets (or other replication objects), KAFKA_BROKER_ID can't be set up in advance. Therefore, one needs to set the IS_KUBERNETES environemnt variable to a non-null value. In this scenario, KAfka's Broker ID will be generated using the value of the HOSTNAME environment variable. Even more, the KAFKA_ADVERTISED_LISTENERS must not be used. Instead, one must set-up only the KAFKA_LISTENERS.

Nevertheless, if one uses Pods, than the usual setup can be used and the IS_KUBERNETES environemnt variable must be ignored.

Dual licensed under:

About

Docker Kafka image for the Confluent Open Source Platform using Oracle JDK

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published