Access Command Line

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 lenses-dev bash
root@fast-data-dev / $ kafka-topics --zookeeper localhost:2181 --list

Alternatively, you can directly execute a Kafka command such as kafka-topics as follows:

docker exec -it lenses-dev kafka-topics --zookeeper localhost:2181 --list