No description, website, or topics provided.
Shell
Pull request Compare This branch is 8 commits ahead, 54 commits behind wurstmeister:master.
Latest commit 8f0c0a4 May 14, 2016 @PalSzak PalSzak Optimize image size
Permalink
Failed to load latest commit information.
image/conf
.gitignore
Dockerfile
LICENSE
README.md
docker-compose.yml
docker-entrypoint.sh

README.md

kafka-docker

Dockerfile for Apache Kafka

The image is available directly from DockerHub

You can browse the source in GitHub

Usage

Pull the image.

$ docker pull dockerkafka/kafka

Start a server.

$  docker run -d --name kafkadocker_zookeeper_1  dockerkafka/zookeeper
$  docker run -d --name kafkadocker_kafka_1 --link kafkadocker_zookeeper_1:zookeeper dockerkafka/kafka

Create a topic.

$  docker run -it --rm --link kafkadocker_zookeeper_1:zookeeper dockerkafka/kafka kafka-topics.sh --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 5 --topic test

Connect to the server ...

Don't bother the WARN Property topic is not valid (kafka.utils.VerifiableProperties) warn. It is a bug KAFKA-1711.

... as a producer.

After connection, you will got a stream. Every line is a new message.

$  docker run -it --rm --link kafkadocker_kafka_1:kafka dockerkafka/kafka kafka-console-producer.sh --broker-list kafka:9092 --topic test

... as a consumer.

After connection, all of the sent messages will be fetched, then wait for new messages.

$  $ docker run -it --rm --link kafkadocker_zookeeper_1:zookeeper --link kafkadocker_kafka_1:kafka dockerkafka/kafka kafka-console-consumer.sh --zookeeper zookeeper:2181 --topic test --from-beginning

Customization

Check out this repository, you will found the default Kafka configuration files under image/conf.

Start the container with the following line, so now you can modify the config in your host, and then start the server.

$  docker run -it --rm --volume `pwd`/image/conf:/opt/kafka_2.10-0.8.2.1/config kafkadocker/kafka /bin/bash

After you finished the customization & testing of the config changes, build your own image.

$  docker build --tag="my-image" .