{"id":21899115,"url":"https://github.com/johnsonlee/docker-kafka","last_synced_at":"2026-05-14T13:38:42.072Z","repository":{"id":150860938,"uuid":"398554744","full_name":"johnsonlee/docker-kafka","owner":"johnsonlee","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-18T12:59:51.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-27T06:15:04.468Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hub.docker.com/repository/docker/johnsonlee/kafka","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnsonlee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-21T12:41:12.000Z","updated_at":"2021-12-18T12:59:54.000Z","dependencies_parsed_at":"2023-09-01T02:48:54.550Z","dependency_job_id":null,"html_url":"https://github.com/johnsonlee/docker-kafka","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Fdocker-kafka","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Fdocker-kafka/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Fdocker-kafka/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Fdocker-kafka/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnsonlee","download_url":"https://codeload.github.com/johnsonlee/docker-kafka/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244911493,"owners_count":20530632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T14:37:49.187Z","updated_at":"2025-10-23T23:56:14.095Z","avatar_url":"https://github.com/johnsonlee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Getting Started\n\n## Create Network\n\n```bash\ndocker network create -d bridge kafka-cluster\n```\n\n## Launch ZooKeeper\n\n```bash\ndocker run -it --rm -w=/opt/kafka-2.8.0 --network=kafka-cluster --name zk \\\n    -p 2181:2181 \\\n    johnsonlee/kafka:2.8.0 \\\n    bin/zookeeper-server-start.sh config/zookeeper.properties\n```\n\n## Launch Kafka\n\n```bash\ndocker run -it --rm -w=/opt/kafka-2.8.0 --network=kafka-cluster --name kafka \\\n    -p 9092:9092 \\\n    -v \"$(pwd)\"/config:/opt/kafka-2.8.0/config \\\n    johnsonlee/kafka:2.8.0 \\\n    bin/kafka-server-start.sh config/server.properties\n```\n\n## Create Topic\n\n```bash\ndocker run -it --rm -w=/opt/kafka-2.8.0 --network=kafka-cluster \\\n    johnsonlee/kafka:2.8.0 \\\n    bin/kafka-topics.sh \\\n    --create \\\n    --topic quickstart-events \\\n    --bootstrap-server kafka:9092\n```\n\n## Write Events\n\nLaunching an interactive console producer by executing the following command:\n\n```bash\ndocker run -it --rm -w=/opt/kafka-2.8.0 --network=kafka-cluster \\\n    johnsonlee/kafka:2.8.0 \\\n    bin/kafka-console-producer.sh \\\n    --topic quickstart-events \\\n    --bootstrap-server kafka:9092\n```\n\nAfter the command promote `\u003e` show in the console, then you can write events (one message per line)\n\n## Read Events\n\nLaunching a console consumer by executing the following command:\n\n```bash\ndocker run -it --rm -w=/opt/kafka-2.8.0 --network=kafka-cluster \\\n    johnsonlee/kafka:2.8.0 \\\n    bin/kafka-console-consumer.sh \\\n    --topic quickstart-events \\\n    --from-beginning \\\n    --bootstrap-server kafka:9092\n```\n\nAfter you write event through the interactive console producer, the event can be received by the console consumer immediately.\n\n## Using K6\n\n### Create Topic for K6\n\n```bash\ndocker run -it --rm -w=/opt/kafka-2.8.0 --network=kafka-cluster \\\n    johnsonlee/kafka:2.8.0 \\\n    bin/kafka-topics.sh \\\n    --create \\\n    --topic k6 \\\n    --bootstrap-server kafka:9092\n```\n\n### Run K6\n\n```bash\ndocker run -it --rm --network=kafka-cluster loadimpact/k6 run \\\n    --logformat=raw \\\n    --out kafka=brokers=kafka:9092,topic=k6,format=json \\\n    - \u003cscenario.js\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnsonlee%2Fdocker-kafka","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnsonlee%2Fdocker-kafka","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnsonlee%2Fdocker-kafka/lists"}