When using the docker image for prometheus, you'd want to volume mount /prometheus so that the data can be re-used when restarting the container. Problem is, that docker will create the path on the host as root. When using a scheduler like nomad and using a persistent disk for /prometheus, the same thing happens.
This is a problem as prometheus runs as nobody, and thus doesn't have access to the path that is created by root.
I propose to use a wrapper script as entrypoint that does a chown -R nobody: /prometheus and then starts prometheus as user nobody.
When using the docker image for prometheus, you'd want to volume mount /prometheus so that the data can be re-used when restarting the container. Problem is, that docker will create the path on the host as root. When using a scheduler like nomad and using a persistent disk for /prometheus, the same thing happens.
This is a problem as prometheus runs as nobody, and thus doesn't have access to the path that is created by root.
I propose to use a wrapper script as entrypoint that does a chown -R nobody: /prometheus and then starts prometheus as user nobody.