当前位置:网站首页>Docker uses redis image

Docker uses redis image

2022-06-11 15:44:00 Ant

Docker Use redis Mirror image

Redis It's an open source , Networked , Key value data storage in memory , With optional persistence .

install redis

docker pull redis

start-up Docker example

docker run --name some-redis -d redis

perhaps Start with persistent storage :

docker run --name some-redis -d redis redis-server --appendonly yes

Bind local port :

docker run --name dev-redis -p 6379:6379 -d redis redis-server --appendonly yes

perhaps adopt redis-cli

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

in addition , If you want to use your own redis.conf ……

You can create your own Dockerfile, The redis.conf Add to / data / in , Just like this. :

FROM redis
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]

perhaps , You can use docker run Option specifies something in the same row :

docker run -v /myredis/conf/redis.conf:/usr/local/etc/redis/redis.conf \ 
--name myredis redis redis-server /usr/local/etc/redis/redis.conf

Sharing plans

Blog content will be synchronized to Tencent cloud + Community , Invite everyone to join us :https://cloud.tencent.com/

license agreement

In this paper A signature - Noncommercial use - Share in the same way 4.0 The international license agreement , Reprint please indicate the source .

原网站

版权声明
本文为[Ant]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203011951054734.html