创建目录
mkdir /app/redis
下载redis.conf文件
wget http://download.redis.io/redis-stable/redis.conf
进入redis.conf,修改:
#bind 127.0.0.1
daemonize no
appendonly yes
运行docker
docker run -p 6379:6379 --name redis --privileged=true -v /app/docker/redis/conf/redis.conf:/etc/redis/redis.conf -v /app/docker/redis/data:/data -it redis:6.0.8 /bin/bash
启动redis
docker exec -it myr3 /bin/bash
redis-cli
无法运行,解决方案:https://blog.csdn.net/weixin_48033662/article/details/136142596
https://blog.csdn.net/Hdu_lc14015312/article/details/104504575