docker安装redis

一、非配置文件方式

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

posted @ 2021-12-22 11:58  b̶i̶n̶g̶.̶  阅读(30)  评论(0编辑  收藏  举报