Sign inSign up

mbe1224/kafka

By mbe1224

Updated almost 8 years ago

Docker Kafka image using Oracle JDK

Image
1

1.5K

mbe1224/kafka repository overview

Docker Kafka image using Oracle JDK

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
  • Verified downloads
  • JAVA_HOME environment variable set up
  • Utility scripts added for generating the configuration files
Usage:

Build the image

docker build -t mbe1224/kafka /1.0.0/

Run the container

docker run -d \
    --net=host \
    --name=kafka \
    -e KAFKA_ZOOKEEPER_CONNECT=localhost:2181 \
    -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 \
    -e KAFKA_BROKER_ID=1 \
    mbe1224/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_ADVERTISED_PORT. KAFKA_ADVERTISED_LISTENERS will be autogenerated using the HOSTNAME and the KAFKA_ADVERTISED_PORT environment variables.

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

Dual licensed under:

Tag summary

Content type

Image

Digest

Size

159.5 MB

Last updated

almost 8 years ago

docker pull mbe1224/kafka