Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis: ERR Rewriting config file: Permission denied when using Docker data volume

Tags:

docker

redis

I am using a redis docker container which reads its configuration file from a separate data-only container. Right now I set the redis.conf file using another container. Now I was experimenting around and I tried using the

> config rewrite

command and I get:

> (error) ERR Rewriting config file: Permission denied

I can't figure out why permission is denied. Any help is appreciated.

like image 590
wracks Avatar asked Dec 17 '25 13:12

wracks


1 Answers

I think redis will create a new temp file on the same folder as the current config file. Then replace the current config file with the temp file.

So it need a permission to write new file in the path.

For example, if your config file is /etc/redis/redis.conf, you have to ensure redis have write permission with /etc/redis/ folder.

For redis:7 docker image, you should do docker exec -u root redis_containenr chown redis:redis /etc/redis

like image 171
PM Extra Avatar answered Dec 19 '25 06:12

PM Extra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!