在这里插入图片描述

Quick reference

Redis | openEuler

Current Redis docker images are built on the openEuler. This repository is free to use and exempted from per-user rate limits.

Redis is the world’s fastest in-memory database. It provides cloud and on-prem solutions for caching, vector search, and NoSQL databases that seamlessly fit into any tech stack—making it simple for digital customers to build, scale, and deploy the fast apps our world runs on. Learn more on the Redis website⁠.

Supported tags and respective Dockerfile links

The tag of each redis docker image is consist of the version of redis and the version of basic image. The details are as follows

Tags Currently Architectures
6.2.7-oe2203lts Redis 6.2.7 on openEuler 22.03-LTS amd64, arm64
7.2.4-oe2203sp3 Redis 7.2.4 on openEuler 22.03-LTS-SP3 amd64, arm64

Usage

In this usage, users can select the corresponding {Tag} and container startup options based on their requirements.

  • Pull the openeuler/redis image from docker
docker pull openeuler/redis:{Tag}
  • Start a redis instance
docker run -d --name my-redis -p 6379:6379 openeuler/redis:{Tag}
  • Start with persistent storage
    As follows, this will save a snapshot of the DB every 60 seconds if at least 1 write operation was performed.
docker run --name my-redis -d openeuler/redis:{Tag} redis-server --save 60 1 --loglevel warning
  • View container running logs
docker logs -f my-redis
  • To get an interactive shell
docker exec -it my-redis /bin/bash
  • Connect to a redis instance

Connect to a local redis instance using loopback address

docker run --name my-redis -d -p 6379:6379 openeuler/redis:{Tag}
redis-cli -h 127.0.0.1 -p 6379

If you want connect the redis instance using hostip, you should connect to the instance using loopback,
and then configure as belows

config set protected-mode no
  • Container startup options
Option Description
-p 6379:6379 Expose redis on localhost:30073.
-e ALLOW_EMPTY_PASSWORD=yes Set to yes to allow connections to redis-server without a password. This setting is not recommended in production environments.
-e REDIS_PASSWORD Set the desired password to be used.
-e REDIS_RANDOM_PASSWORD=1 Set 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=yes Set to no to disallow remote connections to redis-server (i.e., make redis-server listen to 127.0.0.1 only).
-e REDIS_EXTRA_FLAGS Specify extra flags to be passed to redis-server when initializing it.
-v /path/to/redis.conf:/etc/redis/redis.conf Local configuration file redis.conf (try this example⁠). To enable TLS mode, comment the port 6379 line and uncomment the # port 0 and # tls-port 6379 lines.

Question and answering

If you have any questions or want to use some special features, please submit an issue or a pull request on openeuler-docker-images.

Logo

鲲鹏昇腾开发者社区是面向全社会开放的“联接全球计算开发者,聚合华为+生态”的社区,内容涵盖鲲鹏、昇腾资源,帮助开发者快速获取所需的知识、经验、软件、工具、算力,支撑开发者易学、好用、成功,成为核心开发者。

更多推荐