0.10.2.1 (0.10.2.1/Dockerfile)
0.11.0.1 (0.11.0.1/Dockerfile)
0.11.0.2 (0.11.0.2/Dockerfile)
1.0.0, latest (1.0.0/Dockerfile)
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
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:
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.
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.
Content type
Image
Digest
Size
159.5 MB
Last updated
almost 8 years ago
docker pull mbe1224/kafka