1.docker安装Redis
version: '3.1'
services:
redis:
image: daocloud.io/library/redis:5.0.7
restart: always
container_name: redis
environment:
- TZ=Asia/Shanghai
ports:
- 6379:6379
2.两种连接redis方式
1.通过redis-cli连接
docker exec -it 容器id bash # 进入容器
root@9a27afdb3fa4:~# redis-cli # 通过redis-cli连接
127.0.0.1:6379> set name luoluo
OK
127.0.0.1:6379> get name
"luoluo"
2.图形化界面连接
https://github.com/ServiceStack/redis-windows.git # 下载图形化工具
安装完后进行连接