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

CentOS 7 docker prometheus volume error "open /prometheus/lock: permission denied" #4805

Closed
zhangjie2012 opened this Issue Oct 30, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@zhangjie2012
Copy link

zhangjie2012 commented Oct 30, 2018

I want mount /prometheus to host path /data/prometheus,so I create container like this:

docker run -it -d -p 9090:9090 --restart=always -v /data/prometheus:/prometheus -v /data/conf/prometheus.yml:/etc/prometheus/prometheus.yml docker.io/prom/prometheus

start failure, docker logs show :

...
 err="opening storage failed: lock DB directory: open /prometheus/lock: permission denied"

I had change host /data/prometheus dir owner and group to nobody:nobody.

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Oct 30, 2018

You are probably hitting the issue because of SELinux. See https://stackoverflow.com/questions/24288616/permission-denied-on-accessing-host-directory-in-docker

I'm closing it for now. If you have further questions, please use our user mailing list, which you can also search.

@zhangjie2012

This comment has been minimized.

Copy link
Author

zhangjie2012 commented Oct 31, 2018

I had fix it.

  1. create a prometheus container , cat /etc/passwd => nobody:x:65534:65534:nobody:/home:/bin/false
  2. host set /data/prometheus owner and group to 65534
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.