I'm trying to get a .NET API to be able to connect to a Redis instance on my docker network. Here's what I've got:
- Redis container: up and running on custom docker network
my-networkatlocalhost:6379 - .NET service: trying to get up and running on custom docker network
my-network
(Maybe?) Relevant versioning:
- Abp.RedisCache 5.4.0
- StackExchange.Redis 2.1.58
I've tried everything, network inspect, adding and removing both containers to the network, even with the special connection string flag resolveDns=true in my .NET code. No matter what I do I get:
StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). UnableToConnect on localhost:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 0s ago, v: 2.1.58.34321 I'm losing my mind here, Redis is up and running at localhost:6379 on the docker network, why can't .NET connect?
YES I've passed a custom redis.conf which has bind 0.0.0.0 as well.
localhost. It has it's own IP address on the docker network.localhost, even when using docker? Is there a way to specify what IP docker will assign or change this later? (Just for CI / CD concerns and predictability)