Sign inSign up

blacktop/kafka

By blacktop

Updated almost 4 years ago

Alpine Linux based Kafka Docker Image

Image
5

500K+

blacktop/kafka repository overview

kafka-logo

docker-kafka-alpine

CircleCI License Docker Stars Docker Pulls Docker Image

Alpine Linux based Kafka Docker Image

Dependencies

Image Tags

REPOSITORY          TAG                 SIZE
blacktop/kafka      latest              473MB
blacktop/kafka      2.6                 473MB
blacktop/kafka      2.5                 438MB
blacktop/kafka      2.4                 441MB
blacktop/kafka      2.3                 437MB
blacktop/kafka      2.2                 411MB
blacktop/kafka      2.1                 300MB
blacktop/kafka      2.0                 300MB
blacktop/kafka      1.1                 332MB
blacktop/kafka      1.0                 441MB
blacktop/kafka      0.11                226MB
blacktop/kafka      0.10                437MB
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 --brokers=localhost:9092 --topic=test-topic &
$ echo "shrinky-dinks" | kafka-console-producer --brokers=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

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

License

MIT Copyright (c) 2016-2020 blacktop

Tag summary

Content type

Image

Digest

sha256:e59d35a9f

Size

243.4 MB

Last updated

almost 4 years ago

docker pull blacktop/kafka