Docker 安装Redis.md

编辑docker-compose文件

#创建redis数据卷地址
mkdir -p /opt/server/redis && cd /opt/server/redis
#创建docker-compose.yml文件,--requirepass项为redis密码配置
sudo tee docker-compose.yml <<-'EOF'
version: '3.1'
services:
    redis:
        image: redis:5.0.10-alpine3.12
        environment:
            TZ: Asia/Shanghai
        ports:
            - 6379:6379
        command: redis-server --requirepass kqinfo@chis@redis
        volumes:
            - ./redis-data:/var/lib/redis
EOF

启动

#启动mysql up->启动 -d 以守护方式运行
docker-compose -f docker-compose.yml up -d
# redis  docker 

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×