Container port 9092 exposed on host port 9092
HOST
:9092
:9092
Kafka runtime
DOCKER
:9093
Kafka container
Another container
Broker tells
clients to
connect
1 using
kafka:9093
Non-containerized
application or
command line tool
Docker Desktop VM
Host machine
■ Broker tells
clients to
I connect using
localhost:9092
Explanation
The image is a diagram showing how Kafka runtime in a Docker container is exposed and connected to by other containers and non-containerized applications. Kafka runtime is running in a Docker container with another container in the Docker Desktop VM. Port 9092 is exposed on the host, allowing a non-containerized application to connect using localhost:9092. Broker tells clients to connect using kafka:9093.