Running Kafka 1.0 In Docker

With the recent release of Kafka 1.0.0, I have just released the Docker image teivah/kafka (forked from spotify/kafka).

You simply need to run the following command by replacing <DOCKER_HOST> with your Docker host IP:

docker run -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=<DOCKER_HOST> --env ADVERTISED_PORT=9092 teivah/kafka

The Docker image will instantiate a Zookeeper server (port 2181) and a Kafka 1.0.0 (port 9092).

To create a Kafka producer you must run the following command in your Docker instance:

/opt/kafka_2.11-1.0.0/bin/kafka-console-producer.sh --broker-list <DOCKER_HOST>:9092 --topic test

And for a Kafka consumer:

/opt/kafka_2.11-1.0.0/bin/kafka-console-consumer.sh --bootstrap-server <DOCKER_HOST>:9092 --topic test