Hey everyone,
I have a question related to using Consul with Docker, which I hope is a pretty popular use case out there.
I have recently started using spring-cloud-consul in some of my Spring Boot services that run inside Docker containers. I have a few Docker hosts that have Consul agents configured as well. They run natively and not within other docker containers themselves.
I've been having trouble reaching them from within the Docker containers, however, without specifying --net=host on the container. This scares the networking folks as a security problem in that our container can now potentially see things that it shouldn't on the container's host.
The only other way I can think to do this in bridged mode would be to bind the agent to 0.0.0.0, so it is available on the Docker host's loopback interface, then get the IP address of the Docker host running Consul natively into the container through --add-host and some expression evaluated when starting the container (or other hack mentioned in
https://github.com/docker/docker/issues/1143). But this scares the networking folks as well.
Is there a recommended way of doing this -- which ports are safe and should be exposed by the agent when running on a Docker host scenario like this where containers need to be able to talk to the Agent running on the host?
Thanks for any help/advice!
Chris