squeakywheel/redis

By squeakywheel

Updated over 4 years ago

Image

346

Redis | Ubuntu

About Redis

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster. Read more on the Redis website.

Tags and Architectures

TagCurrentlyArchitectures
5.xBETARedis 5.0.7 on Ubuntu 20.04 LTSamd64, arm64, ppc64el, s390x

Usage

Launch this image locally:

docker run -d --name redis-container -e TZ=UTC -p 30073:6379 -e REDIS_PASSWORD=mypassword ubuntu/redis:5.x

Access your MySQL server at localhost:30073.

Parameters

ParameterDescription
-e TZ=UTCTimezone.
-e ALLOW_EMPTY_PASSWORDSet to yes to allow connections to redis-server without a password. This setting is not recommended in production environments.
-e REDIS_PASSWORDSet the desired password to be used.
-e REDIS_RANDOM_PASSWORDSet this variable to 1 if you would like the entrypoint script to generate a random password for you. You will be able to see the generated password in the logs (docker logs).
-e REDIS_ALLOW_REMOTE_CONNECTIONS=yesSet to no to disallow remote connections to redis-server (i.e., make redis-server listen to 127.0.0.1 only).
-e REDIS_EXTRA_FLAGSSpecify extra flags to be passed to redis-server when initializing it.
-p 30073:6379Expose redis on localhost:30073.
-v /path/to/redis.conf:/etc/redis/redis.confLocal configuration fileredis.conf (try this example).

Testing/Debugging

To debug the container:

$ docker logs -f redis-container

To get an interactive shell:

$ docker exec -it redis-container /bin/bash

This image also includes the redis-cli client for interactive container use:

$ docker network create redis-net
$ docker network connect redis-net redis-container
$ docker run -it --rm --network redis-net ubuntu/redis:5.x redis-cli -h redis-container
redis:6379> AUTH mypassword
OK
redis:6379> PING
PONG
redis:6379>

Deploy with Kubernetes

Works with any Kubernetes; if you don't have one, we recommend you install MicroK8s and microk8s enable dns storage then alias kubectl to microk8s.kubectl.

Download redis.conf and redis-deployment.yml. Then:

$ kubectl create configmap redis-config --from-file=redis.conf
$ kubectl apply -f redis-deployment.yml

You will now be able to connect to the Redis server on localhost:30073.

Bugs and feature requests

If you find a bug in our image or want to request a specific feature, please file a bug here:

https://bugs.launchpad.net/ubuntu-docker-images/+filebug

Please title the bug "redis: <reason>".

Make sure to include the digest of the image you are using, from:

$ docker images --no-trunc --quiet ubuntu/redis:<tag>

Docker Pull Command

docker pull squeakywheel/redis