Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

README.md

docker-redis

start a redis instance

$ docker run --name some-redis -d dockerzm/redis:3.2.9

connect to it from an application

$ docker run --name some-app --link some-redis:redis -d application-that-uses-redis

... or via redis-cli

$ docker run -it --link some-redis:redis --rm redis redis-cli -h redis -p 6379

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 -d --name redis -v /docker/redis/redis.conf:/data/redis.conf dockerzm/redis:3.2.9

NOTE:必须先将本地redis.conf文件中daemonize yes注释掉或改为no!

因为daemonize yes 表示redis-server进程在后台运行, 执行完redis-server redis.conf就完了, 这时的shell是没任何东西在运行的,所以docker以为你运行完毕, 所以容器就退出了

About

No description, website, or topics provided.

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.