An image for Kafka which includes a health check
10K+
This image does not start an embedded Zookeeper, instead the image relies on a Zookeeper to be present elsewhere. This enables cluster deployments without Zookeeper hassle. See also:
In addition, the image comes with a health check. This health check is based on native JMX information to keep it pure, rather than sending messages to some kind of test topic. For more details, see:
This image can be used for Openshift/Kubernetes deployments as well.
The latest image uses Kafka 2.0.0
See example below (assuming the Kafka cluster to be running in a separate network):
#!/bin/bash
echo "About to start Kafka-1 as docker container..."
docker run --detach \
--name kafka-1 \
--restart yes \
--network="kafka-cluster" \
--ip="192.168.100.100" \
--volume /var/data/kafka1/config:/etc/kafka/install/config \
--volume /var/data/kafka1/data:/etc/kafka/install/data \
--volume /var/data/kafka1/logs:/etc/kafka/install/logs \
--env "KAFKA.BROKER.ID=1" \
--env "KAFKA.ZOOKEEPER.CONNECT=192.168.100.10:2181,192.168.100.11:2181,192.168.100.12:2181" \
--env "KAFKA.WHAT.EVER=sample" \
technolords/kafka:latest
echo "...done!"
The image knows three volumes:
Note that the volumes must have ownership of an user with uid 500. This is required as Kafka runs as non-root.
For the environment variable to be picked up, it must be prefixed with KAFKA. as the example
shows. If the key does not exist (initially), it will be added to the server.properties
file otherwise it will be updated. Using the example above will cause the property what.ever=sample to be added.
The broker.id must be an unique integer, and zookeeper.connect is a comma separated list of ZooKeeper instances.
For more properties, see:
Content type
Image
Digest
Size
340.9 MB
Last updated
almost 8 years ago
docker pull technolords/kafka