Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker redis -Can't open the log file: No such file or directory

my OS is : ubuntu:15.10

And i want to use the official docker-hub redis , but met problems .

my docker-compose.yml

version: '2'
services:

  redis:
    image: redis
    ports:
      - "6379:6379"
    volumes:
      -  ~/dbdata/redis_conf/redis.conf:/usr/local/etc/redis/redis.conf
    volumes_from:
      -  redisdata
    environment:
      - REDIS_PASSWORD: 29c4181fb842b5f24a3103dbd2ba17accb1f7e3c8f19868955401ab921
    command: redis-server /usr/local/etc/redis/redis.conf

redisdata:
    image: redis
    volumes:
      - /home/keryhu/dbdata/redisdb:/data
    command: --break-redis

I copy the default redis.conf to the "~/dbdata/redis_conf/redis.conf" directory . And just modify the "requirepass" to "29c4181fb842b5f24a3103dbd2ba17accb1f7e3c8f19868955401ab921"

when i start the container ,i met an error -

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 103
>>> 'logfile /var/log/redis/redis-server.log'
Can't open the log file: No such file or directory

Can help me ?

like image 996
Kery Hu Avatar asked Mar 12 '16 09:03

Kery Hu


1 Answers

As I can see here, the log file is not specified and all logs output to the stdout. I wouldn't change this behaviour because in that way docker will manage logs on his own which is standard and even more flexible way.

If you want to redirect logs output somewhere I would suggest using logging directive of the composer.

like image 69
max Avatar answered Nov 07 '22 16:11

max