1.下载Redis镜像
sudo docker pull redis
2.启动Redis
sudo mkdir -p /mydata/redis/conf sudo touch /mydata/redis/conf/redis.conf sudo docker run -p 6379:6379 --name redis \ -v /mydata/redis/data:/data \ -v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf \ -d redis redis-server /etc/redis/redis.conf
3.测试Redis是否启动
sudo docker exec -it redis redis-cli set a b get a
4.Redis持久化配置
在redis.conf中配置 appendonly yes
标签:mydata,Redis,sudo,redis,conf,Docker,安装,docker From: https://www.cnblogs.com/zengwb/p/16601072.html