--net=host
option in the Docker documentation for more information.Currently Redis Cluster does not support NATted environments and in general environments where IP addresses or TCP ports are remapped.
Docker uses a technique called port mapping: programs running inside Docker containers may be exposed with a different port compared to the one the program believes to be using. This is useful in order to run multiple containers using the same ports, at the same time, in the same server.
In order to make Docker compatible with Redis Cluster you need to use
the host networking mode of Docker. Please check the --net=host
option
in the Docker documentation for more information.
The part I marked in blue (the first sentence) is where Redis Cluster's requirements are described: no remapped ports. The part I marked in red (the second sentence) explains the problem with standard Docker containers, with a more explicit description of the problem: "exposed with a different port". Finally the remainder of the paragraph suggests the Docker configuration to disable the usual port remapping.
That is, it suggests the Docker configuration that worked at the time the documentation page was written. And some posts in that Docker forum thread indicate the '--net=host' configuration works as expected (and as documented) in every environment besides MacOS. On top of that, the thread shows the same configuration used to work in MacOS - it's only more recent Docker for Mac versions that --net=host is not sufficient.
You're asking what will work with Docker's current MacOS version, which is a good question. I'm a DevOps guy, and not a Docker expert or Redis developer, so I don't have experience I can use to dredge the answer out of the Docker documentation. That Docker forum thread has Docker users asking how to make it work, and they couldn't seem to end up with a clear answer either.
The problem is coming from behavior that is peculiar to recent versions of Docker on Mac. Unless someone in the Redis community has already solved this (and can contribute to this thread), I think your best chances of learning the right configuration are going to come from engaging Docker support.