Connecting to Kafka under Docker is the same as connecting to a normal Kafka cluster. If your cluster is accessible from the network, and the advertised hosts are setup correctly, we will be able to connect to your cluster.
Read more about Kafka Listeners here:
Kafka Listeners - Explained
Kafka Listeners - Explained
Kafka on Docker on Localhost
Method 1 (recommended)
To run Kafka on Docker on Localhost properly, we recommend you use this project:
GitHub - conduktor/kafka-stack-docker-compose: docker compose files to create a fully working kafka stack
GitHub
The README should tell you how to get started.
Example
1
docker-compose -f zk-single-kafka-single.yml up
Copied!
Then, you can connect to Kafka on 127.0.0.1:9092 using Conduktor!