Skip to content

docker hub:

https://hub.docker.com/r/bitnami/redis

拉取镜像

docker pull bitnami/redis:4.0.14

创建容器:

docker create --name redis-db \
    -e ALLOW_EMPTY_PASSWORD=yes \
    -v /Volumes/Study/data/redis/conf/redis.conf:/opt/bitnami/redis/etc/redis.conf \
    -v /Volumes/Study/data/redis/data:/bitnami/redis/data \
    -v /Volumes/Study/data/redis/logs:/var/lib/redis/logs \
    -p 6379:6379 \
    bitnami/redis:4.0.14

redis.conf 重要的配置项:


# The filename where to dump the DB
dbfilename dump.rdb

dir /bitnami/redis/data

pidfile /var/lib/redis/logs/redis.pid

logfile "/var/lib/redis/logs/redis.log"