Running Redis in Docker

These are the quick notes.


Redis uses port 6379 as the default, which is where those ports in the command come from.


docker pull redis
docker run -d -p 6379:6379 --name redis redis

Use it with python-redis

import redis
client = redis.Redis("localhost", 6379)

The client.keys() is a double-check. The client object won't actually try to connect to the server until you call it.