2021-08-19 1 分钟 0.2 k0次访问
docker安装redis
1.拉取镜像
命令1
| docker pull redis:latest
|
2.运行shell
命令1 2 3 4 5 6
| docker run -p 6379:6379 --name redis \ -v /home/jmlib/docker-v/redis/redis.conf:/etc/redis/redis.conf \ -v /home/jmlib/docker-v/redis/data:/data \ --restart=always \ -d redis redis-server /etc/redis/redis.conf \ --appendonly yes
|
mac环境1 2 3 4 5
| docker run -p 6379:6379 --name redis \ -v /Users/lizihan/Desktop/docker-v/redis/redis.conf:/etc/redis/redis.conf \ -v /Users/lizihan/Desktop/docker-v/redis/data:/data \ -d redis redis-server /etc/redis/redis.conf \ --appendonly yes
|
home配置1 2 3 4 5 6
| docker run -p 6379:6379 --name redis \ -v /home/sakiraven/docker-v/redis/redis.conf:/etc/redis/redis.conf \ -v /home/sakiraven/docker-v/redis/data:/data \ --restart=always \ -d redis redis-server /etc/redis/redis.conf \ --appendonly yes
|
3.conf配置
基础配置1 2 3 4
| #bind 127.0.0.1 protected-mode no appendonly yes requirepass *****
|