ubuntu/redis

Verified Publisher

By Canonical

Updated 7 months ago

Redis, an open source key-value store. Long-term versions maintained by Canonical.

Image
Databases & Storage

100K+

Redis™ software | Ubuntu

Current Redis™ software Docker Image from Canonical, based on Ubuntu. Receives security updates and tracks the newest combination of Redis™ software and Ubuntu. This repository is free to use and exempted from per-user rate limits.

About Redis™ software

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

LTS Up to 5 years free security maintenance on LTS channels.

ESM Up to 10 years customer security maintenance from canonical/redis. Request access.

Tags in italics are not available in ubuntu/redis but are shown here for completeness.

Channel TagCurrentlyArchitectures
6.2-22.04_betaRedis™ software 6.2 on Ubuntu 22.04 LTSamd64, arm64, ppc64el, s390x
track_risk

Channel Tag shows the most stable channel for that track. A track is a combination of both the application version and the underlying Ubuntu series, eg 1.0-22.04. Channels are ordered from the most stable to the least stable, candidate, beta, edge. More risky channels are always implicitly available. So if beta is listed, you can also pull edge. If candidate is listed, you can pull beta and edge. When stable is listed, all four are available. Images are guaranteed to progress through the sequence edge, beta, candidate before stable.

Commercial use and Extended Security Maintenance channels

If your usage includes commercial redistribution or requires unavailable channels/versions, please get in touch with the Canonical team (or using rocks@canonical.com).

Usage

Launch this image locally:

docker run -d --name redis-container -e TZ=UTC -p 30073:6379 -e REDIS_PASSWORD=mypassword ubuntu/redis:6.2-22.04_beta

Access your Redis 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). To enable TLS mode, comment the port 6379 line and uncomment the # port 0 and # tls-port 6379 lines.

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-network
$ docker network connect redis-network redis-container
$ docker run -it --rm --network redis-network ubuntu/redis:6.2-22.04_beta redis-cli -h redis-container

Now you can:

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 snap alias microk8s.kubectl kubectl.

Download redis.conf and redis-deployment.yml and set containers.redis.image in redis-deployment.yml to your chosen channel tag (e.g. ubuntu/redis:6.2-22.04_beta), then:

kubectl create configmap redis-config --from-file=redis=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: <issue summary>". Make sure to include the digest of the image you are using, from:

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

Deprecated channels & tags

These channels (tags) are not updated anymore. Please upgrade to newer channels, or reach out if you can't upgrade.

TrackVersionEOLUpgrade Path
6.0-21.10Redis™ software 6.0.15 on Ubuntu 21.10 07/2022 6.2-22.04_beta
6.0-21.04Redis™ software 6.0.11 on Ubuntu 21.04 01/20226.0-21.10
5.0-20.04Redis™ software 5.0.7 on Ubuntu 20.04 LTS01/20216.0-21.04
track

Docker Pull Command

docker pull ubuntu/redis