Run a local Kafka cluster for testing event-driven applications without a manual Kafka install.
Scale a multi-broker Kafka cluster up or down with a single docker-compose scale command.
Configure Kafka options like max message size or topic auto-creation through environment variables in a Compose file.
Set up automatic topic creation at startup with specific partition counts and replica factors.
Networking is the trickiest part, the advertised hostname must be set to your host IP for clients outside Docker to connect.
This repository provides a Docker image for running Apache Kafka, a system used to pass large volumes of messages between applications reliably and at high speed. Docker is a tool that packages software into containers so it runs consistently regardless of where you deploy it. Kafka itself is often described as a message broker: applications send data to it, other applications read that data, and Kafka manages the flow between them. The image is published on Docker Hub and can be pulled directly. To run a basic Kafka cluster on your own machine, you edit a configuration file to set your host's IP address, then start everything with a single docker-compose command. You can also scale up to multiple brokers with one more command, or tear the whole cluster down just as easily. Configuration is done through environment variables rather than editing config files inside the container. If you want to change a Kafka setting, you prefix it with KAFKA_ in your docker-compose file and the image applies it automatically. For example, setting KAFKA_MESSAGE_MAX_BYTES adjusts the maximum message size, and setting KAFKA_AUTO_CREATE_TOPICS_ENABLE to false prevents Kafka from creating topics on its own. You can also have the image create topics automatically at startup by specifying names, partition counts, and replica counts in a single environment variable. Networking is the trickiest part of running Kafka in Docker, and the README calls this out explicitly, pointing to a separate wiki page dedicated to connectivity. The advertised hostname, which tells Kafka clients how to reach the broker, can be set directly or computed from a shell command, which is useful when running in cloud environments where IP addresses are assigned dynamically. The project also supports configuring broker IDs, logging behavior via log4j, and listener protocols. A single-broker configuration file is included for simpler local setups.
← wurstmeister on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.