I’m following the steps explained here:
- https://www.docker.com/blog/how-to-use-the-redis-docker-official-image/
- https://hub.docker.com/_/redis/
I have a docker-compose.yml
file like this:
version: '3'
services:
backend:
build: server/
image: cno/api
environment:
NODE_ENV: "production"
ports:
- "9114:9114"
networks:
- cnonetwork
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
- redis
redis:
build: redis/
image: cno/redis
networks:
- cnonetwork
frontend:
build: client/
image: cno/client
networks:
- cnonetwork
rp:
build: reverse-proxy/
image: cno/rp
depends_on:
- frontend
- backend
ports:
- "80:80"
networks:
- cnonetwork
networks:
cnonetwork:
And my Dockerfile
of Redis is here:
FROM redis
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
The redis.conf
being the same suggested in the documentation (https://github.com/redis/redis/blob/unstable/redis.conf). My container exits with this error:
*** FATAL CONFIG FILE ERROR (Redis 7.0.9) ***
Reading the configuration file, at line 415
>>> 'locale-collate ""'
Bad directive or wrong number of arguments
I have the same error when I change the config file:
*** FATAL CONFIG FILE ERROR (Redis 7.0.9) ***
Reading the configuration file, at line 415
>>> 'locale-collate "en_US.UTF-8"'
Bad directive or wrong number of arguments
What am I doing wrong?
2
Answers
It looks like you are using the
unstable
version of theredis.conf
file with the Redis 7.0.9 release ofredis-server
.This version does not yet appear to support the
locale-collate
configuration parameter, which is probably why it errors when faced with a config file that contains this.Here’s the code for the config file for 7.0.9 tag which doesn’t mention
locale-collate
:https://github.com/redis/redis/blob/7.0.9/src/config.c
I’d advise using the 7.0.9 version of the config file, or if you really need this parameter then compile an unstable version of
redis-server
.Here’s the 7.0.9 config file:
https://github.com/redis/redis/blob/7.0.9/redis.conf
Always refer to
https://github.com/redis/redis/blob/<redis_version>/redis.conf
. For example if you are using 7.0.11 refer tohttps://github.com/redis/redis/blob/7.0.11/redis.conf
. In7.0.11
the following section is not even defined.