Skip to content

Redis

install

docker

version: '3.7'

services:
  redis:
    hostname: redis
    # 启动容器名称redis
    container_name: redis
    # 使用redis 5.7.20的镜像
    image: redis:5.0.14
    # 自启动
    restart: always
    ports:
      # 容器6379端口映射到宿主机6339端口, 左为宿主机
      - "6339:6379"
    volumes:
      # 指定redis配置文件启动
      - /etc/redis/redis.conf:/etc/redis/redis.conf
      - /data/docker/redis:/data
    command: ["redis-server", "/etc/redis/redis.conf"]
    privileged: true
  • exec format error

镜像架构不匹配

docker pull arm64v8/redis:6.0.7