redis

library/redis

Redis 官方 Docker 镜像,提供开箱即用的高性能键值数据库服务,适合作为缓存、会话存储、消息队列和排行榜等场景的基础组件,支持持久化与多架构部署,适合本地开发与生产环境按需扩展使用。

1.4万 次收藏下载次数: 0状态:Docker 官方镜像维护者:Docker 官方镜像仓库类型:镜像最近更新:19 天前
让 AI 帮你使用轩辕镜像?

如果你使用 DeepSeek元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。

只需在 AI 对话中先发送下面这句话即可:

请先完整阅读并严格遵守以下文档中的全部规则与要求:

https://xuanyuan.cloud/agents.md

在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。

查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AIDeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。

下载命令
点击查看

Quick reference

  • Maintained by:
    https://redis.io/

  • Where to get help:
    https://dockr.ly/comm-slack, Server Fault, https://unix.stackexchange.com/help/on-topic, or https://stackoverflow.com/help/on-topic

Supported tags and respective Dockerfile links

  • https://github.com/redis/docker-library-redis/blob/40511fc518c300f3b48059daf43c7ac2ef97550b/debian/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/40511fc518c300f3b48059daf43c7ac2ef97550b/alpine/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/0076c90a8028d29b25313f7272fa2d1245c3be76/debian/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/0076c90a8028d29b25313f7272fa2d1245c3be76/alpine/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/75ad715d290fef57489d801696d4c75ceb97e1fe/debian/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/75ad715d290fef57489d801696d4c75ceb97e1fe/alpine/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/75cd859f27eb5b534583eac9f4c166a87160192a/debian/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/75cd859f27eb5b534583eac9f4c166a87160192a/alpine/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/2b76f51f4af2f8586e137c49c55bfedb41d6751c/debian/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/2b76f51f4af2f8586e137c49c55bfedb41d6751c/alpine/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/0a362f52c58445de1faf950919711fd1afab319a/debian/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/0a362f52c58445de1faf950919711fd1afab319a/alpine/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/2598ca399aad20a20058ba8d043f4ac54207d994/debian/Dockerfile

  • https://github.com/redis/docker-library-redis/blob/2598ca399aad20a20058ba8d043f4ac54207d994/alpine/Dockerfile

Quick reference (cont.)

  • Where to file issues:
    https://github.com/redis/docker-library-redis/issues?q=

  • Supported architectures: (https://github.com/docker-library/official-images#architectures-other-than-amd64)
    https://hub.docker.com/r/amd64/redis/, https://hub.docker.com/r/arm32v5/redis/, https://hub.docker.com/r/arm32v6/redis/, https://hub.docker.com/r/arm32v7/redis/, https://hub.docker.com/r/arm64v8/redis/, https://hub.docker.com/r/i386/redis/, https://hub.docker.com/r/mips64le/redis/, https://hub.docker.com/r/ppc64le/redis/, https://hub.docker.com/r/riscv64/redis/, https://hub.docker.com/r/s390x/redis/

  • Published image artifact details:
    https://github.com/docker-library/repo-info/blob/master/repos/redis (https://github.com/docker-library/repo-info/commits/master/repos/redis)
    (image metadata, transfer size, etc)

  • Image updates:
    https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fredis
    https://github.com/docker-library/official-images/blob/master/library/redis (https://github.com/docker-library/official-images/commits/master/library/redis)

  • Source of this description:
    https://github.com/docker-library/docs/tree/master/redis (https://github.com/docker-library/docs/commits/master/redis)

What is Redis?

Redis is the world’s fastest data platform. 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.

https://redis.io

!https://raw.githubusercontent.com/docker-library/docs/0e42ee108b46e1ba6333e9eb44201b8f26c4032d/redis/logo.png

Security

For the ease of accessing Redis from other containers via Docker networking, the "Protected mode" is turned off by default. This means that if you expose the port outside of your host (e.g., via -p on docker run), it will be open without a password to anyone. It is highly recommended to set a password (by supplying a config file) if you plan on exposing your Redis instance to the internet. For further information, see the following links about Redis security:

  • https://redis.io/docs/latest/operate/oss_and_stack/management/security/
  • https://redis.io/docs/latest/operate/oss_and_stack/management/security/#protected-mode
  • A few things about Redis security by antirez

Process User and Privileges

By default, the Redis Docker image drops privileges by switching to the redis user and removing unnecessary capabilities. This step is skipped if Docker is run with the --user option or if you set the SKIP_DROP_PRIVS=1 (since 8.0.2) environment variable.

Note: Using SKIP_DROP_PRIVS is not recommended, as it reduces the container's security.

How to use this image

Start a redis instance

console
$ docker run --name some-redis -d redis

Start with persistent storage

console
$ docker run --name some-redis -d redis redis-server --save 60 1 --loglevel warning

There are several different persistence strategies to choose from. This one will save a snapshot of the DB every 60 seconds if at least 1 write operation was performed (it will also lead to more logs, so the loglevel option may be desirable). If persistence is enabled, data is stored in the VOLUME /data, which can be used with --volumes-from some-volume-container or -v /docker/host/dir:/data (see https://docs.docker.com/engine/tutorials/dockervolumes/).

For more about Redis persistence, see https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/.

File and Directory Permissions

Redis will attempt to correct the ownership and permissions of the data and configuration (since 8.0.2) directories and files if they are not set correctly. This adjustment is only performed in basic, default scenarios to avoid interfering with custom or user-specific configurations.

You can skip this step by setting the SKIP_FIX_PERMS=1(since 8.0.2) environment variable.

Manually Setting File and Directory Permissions

If you prefer to handle file permissions yourself, you can use a docker run command to set the correct ownership on mounted volumes. For example:

console
$ docker run --rm -v /your/host/path:/data redis chown -R redis:redis /data

Connecting via redis-cli

console
$ docker run -it --network some-network --rm redis redis-cli -h some-redis

Additionally, if you want to use your own redis.conf ...

You can create your own Dockerfile that adds a redis.conf from the context into /data/, like so.

dockerfile
FROM redis
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]

Alternatively, you can specify something along the same lines with docker run options.

console
$ docker run -v /myredis/conf:/usr/local/etc/redis --name myredis redis redis-server /usr/local/etc/redis/redis.conf

Where /myredis/conf/ is a local directory containing your redis.conf file. Using this method means that there is no need for you to have a Dockerfile for your redis container.

The mapped directory should be writable, as depending on the configuration and mode of operation, Redis may need to create additional configuration files or rewrite existing ones.

Image Variants

The redis images come in many flavors, each designed for a specific use case.

redis:<version>

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.

Some of these tags may have names like bookworm or trixie in them. These are the suite code names for releases of https://wiki.debian.org/DebianReleases and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Debian.

redis:<version>-alpine

This image is based on the popular [***] available in https://hub.docker.com/_/alpine. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.

This variant is useful when final image size being as small as possible is your primary concern. The main caveat to note is that it does use https://musl.libc.org instead of https://www.etalabs.net/compare_libcs.html, so software will often run into issues depending on the depth of their libc requirements/assumptions. See this Hacker News comment thread for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.

To minimize image size, it's uncommon for additional related tools (such as git or bash) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the https://hub.docker.com/_/alpine/ for examples of how to install packages if you are unfamiliar).

License

Starting with Redis 8.0, Redis follows a tri-licensing model with the choice of the https://redis.io/legal/rsalv2-agreement/, https://redis.io/legal/server-side-public-license-sspl/, or the https://opensource.org/license/agpl-v3. Prior versions of Redis (<=7.2.4) are licensed under https://opensource.org/license/bsd-3-clause%E2%81%A0, and Redis 7.4.x-7.8.x are licensed under the dual https://redis.io/legal/rsalv2-agreement/ or https://redis.io/legal/server-side-public-license-sspl/ license.

Please also view the https://redis.io/legal/licenses/ and the https://redis.io/legal/trademark-policy/.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

Some additional license information which was able to be auto-detected might be found in https://github.com/docker-library/repo-info/tree/master/repos/redis.

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

更多相关 Docker 镜像与资源

以下是 redis 相关的常用 Docker 镜像,适用于 缓存、高可用、数据分析 等不同场景:

  • bitnami/redis Docker 镜像说明(企业级配置,适合生产环境)
  • redislabs/redis Docker 镜像说明(官方实验与扩展版本)
  • arm64v8/redis Docker 镜像说明(Redis 数据库,ARM64 架构版本)
  • mcp/redis Docker 镜像说明(Redis 的 MCP 服务端,适合缓存/数据访问的自动化集成)
  • bitnamilegacy/redis Docker 镜像说明(Bitnami Legacy 打包的 Redis,适合沿用 Bitnami 目录与配置的存量 Redis 部署)

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面

轩辕镜像加速拉取命令点我查看更多 redis 镜像标签

docker pull docker.xuanyuan.run/redis:<标签>

DockerHub 原生拉取命令

docker pull redis:<标签>

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

专业版 · 高速稳定拉取镜像
50GB 仅 ¥7/年
高速镜像下载在线技术支持99.95% SLA 保障付费会员免广告