A Docker image based on based on the smallest Linux - Alpine with latest OpenJDK, Kafka Manager
1.0K
A Docker image based on the smallest Linux - Alpine with latest OpenJDK, Kafka Manager.
https://github.com/TerrenceMiao/docker/images/kafka-managerā
š docker run -it --rm -p 9000:9000 -e ZK_HOSTS="10.101.32.74:2181" jtech/kafka-manager
Without luxury DNS resolver, "10.101.32.74" is the ip address of host that Zookeeper and Kafa run on.
Without define ZK_HOSTS, default value is "localhost:2181"
Other runtime options, for example:
š docker run -it --rm -p 9000:9000 -e ZK_HOSTS="10.101.32.74:2181" -e APPLICATION_SECRET=letmein jtech/kafka-manager
š docker run -it --rm -p 9000:9000 -e ZK_HOSTS="10.101.32.74:2181" -e APPLICATION_SECRET=letmein -e KM_ARGS=-Djava.net.preferIPv4Stack=true jtech/kafka-manager
š docker run -it --rm -v /Users/terrence/kafka-manager/conf:/config -e KM_CONFIGFILE=/config/application.conf -p 9000:9000 --name kafka-manager jtech/kafka-manager
kafka-manager.zkhosts=${?ZK_HOSTS}
kafka-manager.zkhosts="10.101.32.74:2181"
š docker run -d --net=host --name=zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 -e ZOOKEEPER_TICK_TIME=2000 confluentinc/cp-zookeeper
š docker logs zookeeper
š docker run -d --net=host --name=kafka -e KAFKA_ZOOKEEPER_CONNECT=localhost:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 confluentinc/cp-kafka
š docker logs kafka
š docker run --net=host --rm confluentinc/cp-kafka kafka-topics --create --topic test --partitions 1 --replication-factor 1 --if-not-exists --zookeeper localhost:2181
š docker run --net=host --rm confluentinc/cp-kafka kafka-topics --describe --topic test --zookeeper localhost:2181
š docker run --net=host --rm confluentinc/cp-kafka bash -c "seq 42 | kafka-console-producer --broker-list localhost:9092 --topic test && echo 'Produced 42 messages.'"
š docker run --net=host --rm confluentinc/cp-kafka kafka-console-consumer --bootstrap-server localhost:9092 --topic test --new-consumer --from-beginning --max-messages 42
Or with Docker Compose:
š docker-compose up
Go to http://localhost:9000ā Kafka Manager UI.
Add a Kafka cluster at first. Give zookeeper:2181 as Cluster Zookeeper Hosts. Others use default values.

Visit "test" topic in Kafka cluster.

Copyright Ā© 2019 - Terrence Miao. Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3).
Content type
Image
Digest
Size
146.6 MB
Last updated
over 7 years ago
docker pull jtech/kafka-manager