This is a fork of Spotify's Kafka in Docker container. Unlike Spotify's, it does not include Zookeeper in-container, as this is intended for testing use in Kubernetes (where it's relatively easy to bring up a separate Zookeeper pod and services).
The kafkaproxy has been removed from this fork. You should use Spotify's container or repository for that.
There are no library Docker images for Kafka and I trust Spotify more than most random Docker Hub users to have a usable base.
docker run -p 127.0.0.1:9092:9092 \
-e KAFKA_ADV_ADDR=localhost \
-e KAFKA_ZK_CONNECT=zookeeper:2181 \
spiffastic/kafka
KAFKA_SERVER_CONFIG = /opt/kafka/config/server.properties
The location of the Kafka server.properties file. If a file at this location
already exists, it is used instead of generating a config from the following
variables.
KAFKA_BROKER_ID = 0
The broker ID.
The following variables can be used to configure kafka in the absence of a complete listeners list.
KAFKA_LISTEN_ADDR = ''KAFKA_LISTEN_PORT = 9092KAFKA_LISTEN_PROTOCOL = PLAINTEXTKAFKA_ADV_PROTOCOL = ${KAFKA_PROTOCOL}KAFKA_ADV_ADDR = $(hostname -f)KAFKA_ADV_PORT = ${KAFKA_PORT}Otherwise, you can set the following variables yourself and not generate them from the above few.
KAFKA_LISTENERS = ${KAFKA_PROTOCOL}://${KAFKA_ADDR}:${KAFKA_PORT}
KAFKA_ADV_LISTENERS = ${KAFKA_PROTOCOL}://${KAFKA_ADV_ADDR}:${KAFKA_ADV_PORT}
KAFKA_AUTO_CREATE_TOPICS = true
Whether to automatically create topics upon use. (true or false)
The following variables control the Zookeeper connection:
KAFKA_ZK_CONNECT = localhost:2181KAFKA_ZK_TIMEOUT = 6000And additional variables to tweak the generated server.properties:
KAFKA_COMPRESSION = uncompressedKAFKA_NW_THREADS = 3KAFKA_IO_THREADS = 8KAFKA_PARTITIONS = 8KAFKA_SEND_BUFFER = 102400KAFKA_RECV_BUFFER = 102400KAFKA_SOCK_MAXBYTES = 104857600KAFKA_RECOV_THREADS = 1KAFKA_OFFSET_REPL_FACTOR = 1KAFKA_TX_LOG_REPL_FACTOR = 1KAFKA_TX_LOG_MIN_ISR = 1KAFKA_LOG_DIR = /dataKAFKA_LOG_FLUSH_INTERVAL_MSGS = 10000KAFKA_LOG_FLUSH_INTERVAL_MS = 1000KAFKA_LOG_RETENTION_HR = 168KAFKA_LOG_RETENTION_BYTES = 1073741824KAFKA_LOG_SEGMENT_BYTES = 1073741824KAFKA_LOG_RETENTION_CHECK_MS = 300000And, to configure any additional properties not covered here:
KAFKA_SERVER_PROPERTIES = ''If you provide a server.properties in the container (by bind mounting one, such as with a ConfigMap in Kubernetes), these variables have no effect.
spiffastic/kafka
A docker image containing Kafka.
https://registry.hub.docker.com/u/spiffastic/kafka/
docker build -t spifftastic/kafka kafka
Content type
Image
Digest
Size
172.9 MB
Last updated
over 8 years ago
docker pull spifftastic/kafka