sameersbn / docker-redis

Dockerfile to create a Docker container image for Redis.
MIT License
156 stars 140 forks source link

`EXTRA_ARGS` not taking effect #24

Closed silverwind closed 1 year ago

silverwind commented 1 year ago

I'm using docker compose and can't seem to get EXTRA_ARGS to take effect, for example:

version: "3"

services:
  redis:
    image: redis:7
    environment:
      EXTRA_ARGS: --loglevel warning

produces a startup log like

redis-1  | 1:C 05 Dec 2022 11:16:28.739 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis-1  | 1:C 05 Dec 2022 11:16:28.739 # Redis version=7.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
redis-1  | 1:C 05 Dec 2022 11:16:28.739 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis-1  | 1:M 05 Dec 2022 11:16:28.740 * monotonic clock: POSIX clock_gettime
redis-1  | 1:M 05 Dec 2022 11:16:28.741 * Running mode=standalone, port=6379.
redis-1  | 1:M 05 Dec 2022 11:16:28.741 # Server initialized
redis-1  | 1:M 05 Dec 2022 11:16:28.741 * Loading RDB produced by version 7.0.5
redis-1  | 1:M 05 Dec 2022 11:16:28.741 * RDB age 2 seconds
redis-1  | 1:M 05 Dec 2022 11:16:28.741 * RDB memory usage when created 0.87 Mb
redis-1  | 1:M 05 Dec 2022 11:16:28.741 * Done loading RDB, keys loaded: 0, keys expired: 0.
redis-1  | 1:M 05 Dec 2022 11:16:28.741 * DB loaded from disk: 0.000 seconds
redis-1  | 1:M 05 Dec 2022 11:16:28.741 * Ready to accept connections

If I put the argument into command, it works as expected:

version: "3"

services:
  redis:
    image: redis:7
    command: --loglevel warning

The startup log with that is reduced as expected:

redis-1  | 1:C 05 Dec 2022 11:16:41.963 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis-1  | 1:C 05 Dec 2022 11:16:41.963 # Redis version=7.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
redis-1  | 1:C 05 Dec 2022 11:16:41.963 # Configuration loaded
redis-1  | 1:M 05 Dec 2022 11:16:41.964 # Server initialized

Is it a bug or am I just using EXTRA_ARGS incorrectly? I couldn't find any documentation about it in this repo.

silverwind commented 1 year ago

Nevermind, I'm in the wrong repo, https://github.com/docker-library/redis is the right one.