【docker】docker安装redis
1、docker hub
https://hub.docker.com/_/redis
2、创建redis
创建目录
mkidr $HOME/Tools/redis/conf
mkdir $HOME/Tools/redis/data
docker run \ --restart=always \ --log-opt max-size=100m \ --log-opt max-file=2 \ -p 6379:6379 \ --name redis \ -v $HOME/Tools/redis/conf/redis.conf:/etc/redis/redis.conf \ -v $HOME/Tools/redis/data:/data \ -d redis redis-server /etc/redis/redis.conf \ --appendonly yes \ --requirepass 123456
更多参数,详见docker hub
参考链接:
https://blog.csdn.net/weixin_45821811/article/details/116211724