docker安装redis6.0
# 拉取镜像
docker pull redis:6.0
# 创建配置目录
mkdir -p ~/mydata/redis/conf
# 写入配置
echo "appendonly yes" >> ~/mydata/redis/conf/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:6.0 redis-server /etc/redis/redis.conf
docker update redis --restart=always
docker exec -it redis redis-cli