docker安装redis

Updated on with 0 views and 0 comments

docker安装redis

拉取镜像

docker pull redis

运行容器

建立配置文件

mkdir -p /opt/docker_data/redis/latest/data
mkdir -p /opt/docker_data/redis/latest/conf
vi /opt/docker_data/redis/latest/conf/redis.conf

再redis.conf中填写配置信息

bind 0.0.0.0
appendonly yes
requirepass redis123

运行容器

docker run -p 6379:6379 --name redis \
-v /opt/docker_data/redis/latest/data:/data \
-v /opt/docker_data/redis/latest/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