1.下载镜像文件
docker pull redis:3.2
2.创建实例并启动
mkdir -p /mydata/redis/conf
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镜像执行redis-cli命令连接
docker exec -it redis redis-cli
redis-cli
4.开机自启动
docker update redis --restart=always