Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/linux-china/docker-kafka
Kafka Docker image for test
https://github.com/linux-china/docker-kafka
docker-kafka
Last synced: 25 days ago
JSON representation
Kafka Docker image for test
- Host: GitHub
- URL: https://github.com/linux-china/docker-kafka
- Owner: linux-china
- Created: 2016-12-26T12:43:29.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-21T04:36:43.000Z (about 6 years ago)
- Last Synced: 2024-12-24T23:43:25.007Z (27 days ago)
- Topics: docker-kafka
- Language: Shell
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Docker Kafka
===============
Docker image for Kafka### How to build
$ docker build -t spotify/kafka:2.1.0 .
### How to run container
```
$ docker run -p 2181:2181 -p 9092:9092 spotify/kafka:2.1.0
```### How to use with docker-compose
Please add following code in docker-compose.yml```
version: '2'
services:
kafka:
image: spotify/kafka:2.1.0
ports:
- "2181:2181"
- "9092:9092"
environment:
ADVERTISED_HOST: 127.0.0.1
kafka-manager:
image: sheepkiller/kafka-manager
ports:
- "9000:9000"
links:
- kafka
environment:
APPLICATION_SECRET: 123456
ZK_HOSTS: kafka:2181
```### Execute kafka script in container
```
$ docker exec -ti kafka_container_id /opt/kafka_2.11-2.1.0/bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --replication-factor 1 --partitions 1 --topic testTopic
$ docker exec -ti kafka_container_id /opt/kafka_2.11-2.1.0/bin/kafka-topics --list --zookeeper 127.0.0.1:2181
```