由网友(演戏、别当真)分享简介:我正在尝试测试新的Redis 6 ACL配置。我想用尽可能简单的配置运行一个测试,以便熟悉配置。我的Redis将作为Docker容器运行。请考虑到我是一个彻头彻尾的Redis新手。我的Dockerfile:FROM redis:6.2.1COPY redis.conf /usr/local/etc/redis/...![使用Docker搭建Redis cluster环境](https://p.xsw88.cn/allimgs/daicuo/20230903/3229.png)
我正在尝试测试新的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
![使用Docker搭建Redis cluster环境](https://p.xsw88.cn/allimgs/daicuo/20230903/3229.png)
我的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"]
相关推荐
最新文章