docker 安装redis 配置redis.conf
时间: 2023-09-13 10:13:26 浏览: 131
要在Docker中安装Redis并配置redis.conf文件,有几种不同的方法。
一种方法是使用配置文件部署Redis容器。通过运行以下命令,可以将本地的redis.conf文件映射到Redis容器中,并将容器的6379端口映射到主机的6379端口:
```
docker run -itd -p 6379:6379 -v /home/redis/redis.conf:/usr/local/etc/redis/redis.conf -v /home/redis/data/:/data --name myredis -e "TZ=Asia/Shanghai" redis redis-server /usr/local/etc/redis/redis.conf
```
这将创建一个名为"myredis"的Redis容器,其中包含了通过挂载本地的redis.conf文件来配置Redis。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Docker 部署Redis并配置redis.conf](https://blog.csdn.net/bhmww60204/article/details/100953555)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Docker之redis启动映射redis.conf](https://blog.csdn.net/weixin_43821899/article/details/104532920)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文