docker安装redis

Updated on in 程序人生 with 0 views and 0 comments

docker安装redis

拉取镜像

docker pull redis

运行容器

建立配置文件

mkdir -p /opt/mydata/redis/conf \
vi /opt/mydata/redis/conf/redis.conf

再redis.conf中填写配置信息

bind 0.0.0.0
appendonly yes
requirepass redis123

运行容器

docker run -p 6379:6379 --name redis \
-v /opt/mydata/redis/data:/data \
-v /opt/mydata/redis/conf/redis.conf:/etc/redis/redis.conf \
-d redis redis-server /etc/redis/redis.conf

标题:docker安装redis
作者:wenyl
地址:http://www.wenyoulong.com/articles/2020/05/14/1589444659670.html