https://hub.docker.com/_/redis
docker search redis
docker pull docker.io/redis
#具体的版本
docker pull docker.io/redis:5.0.5
Additionally, If you want to use your own redis.conf
You can create your own Dockerfile that adds a redis.conf from the context into /data/, like so.
FROM redis
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
Alternatively, you can specify something along the same lines with docker run
options.
docker run -v /myredis/conf/redis.conf:/usr/local/etc/redis/redis.conf --name myredis redis redis-server /usr/local/etc/redis/redis.conf
# 数据存储到主机 myredis是个性化过的redis
docker run -d -v /redisdata/redis1:/data --name selfredis myredis --privileged=true redis-server /usr/local/etc/redis/redis.conf
# -v 参数
-v /hostpath:/dockerpath