使用ACL的Redis Docker映像 [英] Redis Docker image using ACL

查看:0
本文介绍了使用ACL的Redis Docker映像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试测试新的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中缺少某些内容,但我找不到适合我需要的文档。

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

推荐答案

here明确说明:

# 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"]

这篇关于使用ACL的Redis Docker映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆