sameersbn / docker-redis

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

*** FATAL CONFIG FILE ERROR *** #3

Closed BerndDoser closed 9 years ago

BerndDoser commented 9 years ago

Building the latest commit using

docker build -t redis .

and printing the version of redis

docker run redis redis-server --version

I get following error message:

Starting redis-server...
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 709
>>> 'version'
Bad directive or wrong number of arguments
sameersbn commented 9 years ago

@BerndDoser The image automatically adds /etc/redis/redis.conf to the redis-server arguments list. But redis-server does not like arguments such as --version or --help specified after the redis.conf, for example,

This is ok:

redis-server --help /etc/redis/redis.conf

This is not ok.

redis-server /etc/redis/redis.conf --help

The solution to this issue would appear to specify /etc/redis/redis.conf at the end of the argument list. But this causes issues on the other side as well, eg.

This is ok:

redis-server /etc/redis/redis.conf --loglevel verbose

This is not ok:

redis-server --loglevel verbose /etc/redis/redis.conf

So to remedy this issue, the image will no longer add /etc/redis/redis.conf to the argument list when user specifies the redis-server command.

This will work:

docker run -it --rm sameersbn/redis redis-server --help

This will not:

docker run -it --rm sameersbn/redis --help
BerndDoser commented 9 years ago

Thanks for your very fast solution!