I start a redis container with docker-compose in machine A.
docker-compose.yml.
redis:
ports:
- "6379:6379"
image: redis
on machine A, I can connect to it with redis-cli in terminal.
redis-cli
127.0.0.1:6379>
But I can't connect to it use A's IP on machine B even on machine A itself.
on machine B or A.
redis-cli -h 10.10.10.25
Could not connect to Redis at 10.10.10.25:6379: Connection timed out
not connected>
It's strange. I can run redis-cli on both host A and host B with A's IP. Following is the output of "docker ps"
After mapping port 6379 of redis container to the host port 6379. The redis service should be available for all network interfaces(0.0.0.0) of host A. So you don't have to change the redis configuration.
Can you show the output of "docker ps"?