Redis Docker镜像使用ACL



我正在尝试测试新的Redis 6 ACL配置。我想用最简单的配置运行一个测试,以熟悉配置。我的Redis将作为Docker容器运行。请考虑一下,我是一个完全的Redis新手。

我的Dockerfile:

FROM redis:6.2.1
COPY redis.conf /usr/local/etc/redis/redis.conf
COPY users.acl /etc/redis/users.acl
EXPOSE 6379

我的redis.conf文件:

aclfile /etc/redis/users.acl

我的users.acl文件:

user test on >password ~* &* +@all

我能够在没有错误的情况下运行容器,但容器似乎没有加载ACL配置:事实上,当我将redis-cli运行到容器中并执行ACL LIST时,我得到的输出是:

1) "user default on nopass ~* &* +@all"

这显然不是预期的。

我担心Dockerfile中遗漏了一些内容,但我找不到适合我需要的文档。

有人有暗示吗?提前谢谢。

正如这里明确指出的:

# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
#
# ./redis-server /path/to/redis.conf

Dockerfile中缺少最后一行:

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

最新更新