Kafka docker box
docker pull lensesio/box
Lenses Box is a docker image that provides a full installation of Apache Kafka with all relevant components.
Lenses Box contains all components of the Apache Kafka eco-system, CLI tools and synthetic data streams:
To learn more check out this 3-minute tour
1. To start with Box get your free development license online.
2. Install docker
Before you get started you will need to install Docker . This Kafka docker container will work even on a low memory 8GB RAM machine.
3. Run the docker
docker run --rm \ -p 3030:3030 \ --name=dev \ --net=host \ -e EULA="https://dl.lenses.stream/d/?id=CHECK_YOUR_EMAIL_FOR_KEY" \ lensesio/box
Note that the value of the
--name parameter can be anything you want.
Just remember to replace
dev with your own value in the
docker exec commands found in this page. Kafka Connect requires a few minutes to
start up since it iterates and loads all the available connectors.
You can also periodically upgrade to the latest versions with:
$ docker pull lensesio/box
To access the Kafka docker web user interface, open your browser and navigate to
To access the various Kafka command-line tools, such as the console producer and the console consumer, from a terminal in the Docker container, you should execute the following command:
docker exec -it dev bash root@fast-data-dev / $ kafka-topics --zookeeper localhost:2181 --list
Alternatively, you can directly execute a Kafka command
kafka-topics as follows:
docker exec -it dev kafka-topics --zookeeper localhost:2181 --list
The broker in the Kafka docker has a broker id
101 and advertises the listener configuration endpoint to accept
If you run Docker on macOS or Windows, you may need to find the address
of the VM running Docker and export it as the advertised listener address for the
broker (On macOS it usually is
192.168.99.100). At the same time, you should
lensesio/box image access to the VM’s network:
docker run -e EULA="CHECK_YOUR_EMAIL_FOR_KEY" \ -e ADV_HOST="192.168.99.100" \ --net=host --name=dev \ lensesio/box
If you run on Linux you don’t have to set the
ADV_HOST but you can do something cool with it.
If you set it to be your machine’s IP address you will be able to access
Kafka from any clients in your network.
If you decide to run box in the cloud, you (and all your team) will be able to access Kafka from your development machines. Remember to provide the public IP of your server as the kafka advertised host for your producers and consumers to be able to access it.
Kafka JMX metrics are enabled by default. Refer to
. Once you expose the relevant port
-p 9581:9581 you can connect to JMX with
If you are using docker-machine or setting this up in a Cloud or
DOCKER_HOST is a custom IP address such as
you will need to use the parameters
--net=host -e ADV_HOST=192.168.99.100.
docker run --rm \ -p 3030:3030 \ --net=host \ -e ADV_HOST=192.168.99.100 \ -e EULA="https://dl.lenses.stream/d/?id=CHECK_YOUR_EMAIL_FOR_KEY" \ lensesio/box
To persist the Kafka data between multiple executions, provide a name for your Docker instance and do not set
the container to be removed automatically (
--rm flag). For example:
docker run \ -p 3030:3030 -e EULA="CHECK_YOUR_EMAIL_FOR_KEY" \ --name=dev lensesio/box
Once you want to free up resources, just press
Now you have two options: either remove the docker:
docker rm dev
Or use it at a later time and continue from where you left off:
docker start -a dev
|Kafka broker (ssl)||9093|
|Kafka broker JMX||9581|
|Schema registry JMX||9582|
|Kafka connect JMX||9584|
|ADV_HOST=[ip-address]||The ip address that the broker will advertise|
|DEBUG=1||Prints all stdout and stderr processes to container’s stdout for debugging.|
|DISABLE_JMX=1||Disables exposing JMX metrics on Kafka services.|
|ELASTICSEARCH_PORT=0||Will not start Elasticsearch.|
|ENABLE_SSL=1||Creates CA and key-cert pairs and makes the broker also listen to SSL://127.0.0.1:9093|
|KAFKA_BROKER_ID=1||Overrides the broker id (the default id is 101).|
|SAMPLEDATA=0||Disables the synthetic streaming data generator that are running by default.|
|SUPERVISORWEB=1||Enables supervisor interface on port 9001 (adjust via SUPERVISORWEB_PORT) to control services.|