conduktor / kafka-stack-docker-compose

docker compose files to create a fully working kafka stack
Apache License 2.0
3.28k stars 1.27k forks source link

All services listen to 0.0.0.0 instead of 127.0.0.1 #26

Closed amosbird closed 6 years ago

amosbird commented 6 years ago

Hi, I have /etc/hosts like this


127.0.0.1     kafka1
127.0.0.1     kafka2
127.0.0.1     kafka3
127.0.0.1     zoo1
127.0.0.1     zoo2
127.0.0.1     zoo3
...

However, docker-compose -f full-stack.yml up still starts all services listening to 0.0.0.0.

simplesteph commented 6 years ago

What's the problem? the entry in /etc/hosts are just here so that your computer solves kafka1 to localhost hence find the docker container

amosbird commented 6 years ago

@simplesteph Oh, I thought the host list also acts as a config for restricting network accessibilities. Does that make sense?

simplesteph commented 6 years ago

no it doesn't restrict network capabilities, it just redirects DNS names to IPs:https://askubuntu.com/questions/183176/what-is-the-use-of-etc-hosts

Your service can be accessible from the outside if the firewall ports are opened. Remember the goal of this is to setup something on your local laptop, nothing more. Happy hacking!

amosbird commented 6 years ago

Hmm, is there a way to run zk-single-kafka-single.yml without modifying /etc/hosts?