docker-compose安装redis

1.docker-compose.yml

# yml
version: "3.9"   # optional since v1.27.0
services:
  redis:
    image: daocloud.io/library/redis:5.0.7
    restart: always
    container_name: redis
    environment:
      - TZ=Asia/Shanghai
    ports:
      - 6379:6379

docker exec -it 容器id bash进入容器内部
redis-cli 连接redis

你可能感兴趣的:(docker-compose安装redis)