docker启动的redis
时间: 2023-10-21 16:26:15 浏览: 96
要启动Docker中的Redis,您可以在具有docker-compose.yml文件的目录下运行以下命令:docker-compose up -d。这将使用Redis 5版本的alpine镜像快速创建并启动Redis容器。如果您的主机上已经安装了Docker服务,您还可以使用docker run命令来启动Redis容器。您可以使用以下命令:docker run -p 6379:6379 --name redis -v /docker/redis/redis.conf:/etc/redis/redis.conf -v /docker/redis/data:/data --restart=always -d redis:7.0.4 redis-server /etc/redis/redis.conf。这将使用Redis 7.0.4版本的镜像,在后台运行Redis容器,并将宿主机的端口映射到容器的6379端口,同时挂载redis.conf文件和持久化数据文件夹。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Docker 启动Redis 并设置密码的操作](https://download.csdn.net/download/weixin_38677725/14888665)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [docker启动redis](https://blog.csdn.net/weixin_45379185/article/details/125933194)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文