端口替换
sed -i 's/port 6379/port 11380/g' redis.conf
密码设置
sed -i 's/# requirepass foobared/requirepass BdZYEXy4gAZDJkNp/g' redis.conf
开启远程访问
sed -i 's/bind 127.0.0.1/#bind 127.0.0.1/g' redis.conf
sed -i 's/protected-mode yes/protected-mode no/g' redis.conf
docker run -p 11380:11380 -v /opt/docker/redis/redis.conf:/usr/local/etc/redis/redis.conf --name redis -d redis redis-server /usr/local/etc/redis/redis.conf
如果文件不可以用则
mkdir /opt/docker/redis -p
wget https://raw.githubusercontent.com/antirez/redis/5.0.0/redis.conf -O /opt/docker/redis/redis.conf