1 拉取最新redis镜像
docker pull redis
2 创建文件夹,配置redis文件
mkdir /root/data
vim /root/redis.conf
# 配置以下内容 密码设定为123456
bind 0.0.0.0
daemonize NO
protected-mode yes
requirepass 123456
3 映射并运行容器
docker run -id -p 6379:6379 --name redis -v /root/redis.conf:/etc/redis/redis.conf -v /root/data:/data redis redis-server /etc/redis/redis.conf
标签:部署,data,redis,conf,0.0,docker,root
From: https://www.cnblogs.com/wellplayed/p/18071419