今天想去修改 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