Public | Automated Build

Last pushed: 2 months ago
Short Description
Run latest Kafka (with Zookeeper) in Docker environment together.
Full Description

Kafka in Docker

This repository provides everything you need to run Kafka (with a Zookeeper) in Docker environment. Image is based on the latest OpenJDK 8.


The main hurdle of running Kafka in Docker is that it depends on Zookeeper.

Compared to other Kafka docker images, this one runs both Zookeeper and Kafka in the same container. This means:

  • No dependency on an external Zookeeper host, or linking to another container
  • Zookeeper and Kafka are configured to work together out of the box


docker run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=$(docker-machine ip $(docker-machine active)) --env ADVERTISED_PORT=9092 --name kafka wlsc/kafka

Kafka Producer

export KAFKA=$(docker-machine ip $(docker-machine active)):9092 --broker-list $KAFKA --topic test

Kafka Consumer

export ZOOKEEPER=$(docker-machine ip $(docker-machine active)):2181 --zookeeper $ZOOKEEPER --topic test

In the box

  • wlsc/kafka

    The docker image with both Kafka and Zookeeper. Built from the kafka

Public Builds

Build from Source

docker build -t wlsc/kafka kafka/
Docker Pull Command
Source Repository