Running Redis in Docker

These are the quick notes.

Install

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

Use it with python-redis

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

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