Public | Automated Build

Last pushed: 3 months ago
Short Description
Alpine Linux based Kafka Docker Image
Full Description

docker-kafka-alpine

Alpine Linux based Kafka Docker Image

Dependencies

Image Tags

REPOSITORY          TAG                 SIZE
blacktop/kafka      latest              234MB
blacktop/kafka      1.0                 234MB
blacktop/kafka      0.11                226MB
blacktop/kafka      0.10                223MB
blacktop/kafka      0.9                 238.6MB
blacktop/kafka      0.8                 227.5MB

Getting Started

NOTE: I am assuming use of Docker for Mac with these examples. (KAFKA_ADVERTISED_HOST_NAME=localhost)

docker run -d \
           --name kafka \
           -p 9092:9092 \
           -e KAFKA_ADVERTISED_HOST_NAME=localhost \
           -e KAFKA_CREATE_TOPICS="test-topic:1:1" \
           blacktop/kafka

This will create a single-node kafka broker (listening on localhost:9092), a local zookeeper instance and create the topic test-topic with 1 replication-factor and 1 partition.

You can now test your new single-node kafka broker using Shopify/sarama's kafka-console-producer and kafka-console-consumer

Required

$ go get github.com/Shopify/sarama/tools/kafka-console-consumer
$ go get github.com/Shopify/sarama/tools/kafka-console-producer

Now start a consumer in the background and then send some data to kafka via a producer

$ kafka-console-consumer --bootstrap-server=localhost:9092 --topic=test-topic &
$ echo "shrinky-dinks" | kafka-console-producer --broker-list=localhost:9092 --topic=test-topic

Documentation

Issues

Find a bug? Want more features? Find something missing in the documentation? Let me know! Please don't hesitate to file an issue

Credits

Heavily (if not entirely) influenced by https://github.com/wurstmeister/kafka-docker

Todo

  • [x] Add ability to run a single node kafka broker when you don't supply a zookeeper link.

CHANGELOG

See CHANGELOG.md

Contributing

See all contributors on GitHub.

Please update the CHANGELOG.md and submit a Pull Request on GitHub.

License

MIT Copyright (c) 2016-2017 blacktop

Docker Pull Command
Owner
blacktop
Source Repository