Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why : Can't open nodes-7771.conf in order to acquire a lock: Permission denied #288

Closed
startjava opened this issue Aug 28, 2021 · 2 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@startjava
Copy link

sudo docker run -v /home/ghy/cluster:/redisConfig -v /home/ghy/cluster/data:/data --privileged=true --name redis6.2.5_master_7771 --network host -d redis:6.2.5 redis-server /redisConfig/redis-7771.conf


1:C 28 Aug 2021 06:43:36.061 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

1:C 28 Aug 2021 06:43:36.061 # Redis version=6.2.5, bits=64, commit=00000000, modified=0, pid=1, just started

1:C 28 Aug 2021 06:43:36.061 # Configuration loaded

1:M 28 Aug 2021 06:43:36.062 * monotonic clock: POSIX clock_gettime

1:M 28 Aug 2021 06:43:36.062 # Can't open nodes-7771.conf in order to acquire a lock: Permission denied

@startjava
Copy link
Author

but i not want use chomd the linux command for "cluster" dir!

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Aug 30, 2021
@wglambert
Copy link

You need to adjust the permissions on /redisConfig/redis-7771.conf for the user (uid 999) running in the container, such as chown 999 redis-7771.conf

Also I would advise not running containers with privileged mode as it gives the container the same capabilities as the host https://containerjournal.com/topics/container-security/why-running-a-privileged-container-is-not-a-good-idea/
Coupled with the notes on security https://github.com/docker-library/docs/tree/master/redis#security

This means that if you expose the port outside of your host (e.g., via -p on docker run), it will be open without a password to anyone

We've had a lot of issues crop up about redis instances becoming compromised #235 and this would be even more unfortunate with the container running as privileged

In the future questions like these should be asked over at the Docker Community Forums, Docker Community Slack, or Stack Overflow. Since these repos aren't really a user-help forum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

2 participants