redis / docker-library-redis

Docker Official Image packaging for Redis
http://redis.io
BSD 3-Clause "New" or "Revised" License
1.12k stars 563 forks source link

>= 7.0.1 doesn't accept custom arguments in command #320

Closed brusch closed 2 years ago

brusch commented 2 years ago

Using docker-compose the following doesn't work anymore:

services:
    redis:
        image: redis:alpine
        command: [ redis-server, --maxmemory 128mb, --maxmemory-policy volatile-lru, --save "" ]

It used to work with all v6 images as well as redis:7.0.0-alpine but starting from redis:7.0.1-alpine startup will fail with the following error message:

| *** FATAL CONFIG FILE ERROR (Redis 7.0.1) ***
| Reading the configuration file, at line 2
| >>> 'maxmemory 128mb "--maxmemory-policy volatile-lru"'
| wrong number of arguments
itamarhaber commented 2 years ago

Hi @brusch

Thanks for reporting this issue. This is a known issue that was introduced in Redis 7.0.1. The fix is at https://github.com/redis/redis/pull/10866 and it will be a part of the next patch-level release of Redis (7.0.3).

brusch commented 2 years ago

@itamarhaber Ah, thanks for clarifying, was not sure if this was Docker related or Redis itself 😊

yosifkit commented 2 years ago

Closing since this is a known upstream issue. I'd recommend just using an adjusted command line the treats every item as separate arguments:

        command: [ redis-server, --maxmemory, 128mb, --maxmemory-policy, volatile-lru, --save, "" ]
brusch commented 2 years ago

@yosifkit thanks for the hint 👍😎