TL;DR: I just want a way to forward trafic to localhost
to the host without using --net=host
I'm running multiple containers on the same host, and need them to access an instance of Redis that's available at localhost:6379. Also, I need to use port forwarding, so using --net=host
is not an option.
How can I start multiple containers and allow all of them to forward trafic to localhost
to the host?
I have also tried docker run --add-host localhost:<private ip address> -p <somehostport>:<somecontainerport> my_image
, with no success (I still get that connection to 127.0.0.1:6379
is refused, as if localhost
was not resolved to the host's private IP)