docker安装redis

# docker search redis 查找

# docker pull redis:4.0.2 

# docker run --name=redis-server -p 6379:6379 -v /opt/redis/data/:/data -d redis:4.0.2 redis-server --appendonly yes   运行redis-server

# docker run --name=redis-cli -it redis:4.0.2 redis-cli -h  ip   运行redis-cli 可以进入命令行

# docker start redis-cli  启动redis-cli

# docker exec  -it  redis-cli  redis-cli -h ip  进入redis-cli

#认证登录 auth password

你可能感兴趣的:(docker)