Try putting the containers on the same network: “ — network kafka”
Every Docker host has a default bridge network (docker0
). All new container will attach to it unless you override it (using --network
flag). Containers will not talk to each other if they are on different networks or inside of docker0.
If you want to know more about it: https://medium.com/hacking-talent/docker-all-you-need-to-know-containers-part-2-31120eeb296f