我希望您在运行在Docker上的Redis服务器上设置密码。我已经按照https://registry.hub.docker.com/_/redis/上的说明进行了操作:
1. 我已经创建了一个包含Dockerfile的文件夹,其中包含以下内容:
1. 我已经创建了一个包含Dockerfile的文件夹,其中包含以下内容:
FROM redis
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
2.我添加了一个redis.conf文件,其中包含:
requirepass thepassword
3.我使用以下命令构建了镜像:
docker build -t ouruser/redis .
4.我启动了容器:
docker run --name my-redis -p 0.0.0.0:6379:6379 -d ouruser/redis redis-server --appendonly yes
Redis服务器没有设置密码!我不明白为什么。