一、非配置文件方式
docker run -itd --name myredis --restart=always -p 6380:6379 redis --requirepass "qwer1234.0" --appendonly yes
二、配置文件方式(挂载外部目录)
docker run -p 6378:6379 --name redis01 -v /root/redis/redis01/conf/redis.conf:/etc/redis/redis.conf -v /root/redis/redis01/data:/data -d redis redis-server /etc/redis/redis.conf --appendonly yes
https://www.cnblogs.com/934827624-qq-com/p/10175478.html