dockerfile

1
2
3
FROM redis
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
1
docker run --name some-redis1 -p 6380:6379  -d redis --requirepass "123456"

redis启动的默认端口号是6379,这个时候宿主机使用6380进行映射,并设置授权密码123456,

启动redis

1
docker run --name redis-rpc -p 6379:6379 -d redis  --requirepass "duolabmeng"