今天想去修改 redis 的配置,才发现默认安装的时候并无添加 redis 的配置。因此重装配置下。redis
编辑 redis/Dockerfile
以下docker
FROM redis:latest LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>" ## For security settings uncomment, make the dir, copy conf, and also start with the conf, to use it RUN mkdir -p /usr/local/etc/redis COPY redis.conf /usr/local/etc/redis/redis.conf VOLUME /data EXPOSE 6379 CMD ["redis-server", "/usr/local/etc/redis/redis.conf"] #CMD ["redis-server"]
默认状况 redis
目录下有 redis.conf
文件,修改如下两点便可ui
bind 127.0.0.1
protected-mode
改成 no
其余配置根据本身状况进行修改。code
laradock
目录docker-compose stop redis
docker-compose build --no-cache redis
docker-compose up -d redis
正常状况就启动成功了。server
参考资料:laradock redis 配置记录、redis解决(DENIED Redis is running in protected mode because prote)。blog