Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd Dockerfile environment variables to control CMD arguments #3385
Comments
dsvensson
referenced this issue
Oct 31, 2017
Closed
Add support for log.level in config/environment #3384
This comment has been minimized.
This comment has been minimized.
|
Dupe of #3384 |
brian-brazil
closed this
Nov 1, 2017
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil Not duplicate. #3384 was about adding support in Prometheus for reading log.level from config file, in addition to command line argument. As you said, it's better to have one way, and only one way of handling that. This issue was about exposing control over Prometheus startup in docker-compose files by having an entrypoint that builds up the command-line based on docker-compose.yml settings, as Prometheus has an official Docker image at DockerHub. The alternative today is adding the whole command-line to docker-compose.yml which looks kind of dirty as you have to include all command line arguments, even those you don't want to change. Too bad you don't see the value in that, but it is what it is. |
dsvensson
referenced this issue
Nov 1, 2017
Closed
Change --log.level=info to --log.level=warn in Dockerfile #3386
This comment has been minimized.
This comment has been minimized.
PatrickOsborne
commented
Feb 28, 2018
|
I'd like to override the config file used in the image. What would be the best way to do that? |
This comment has been minimized.
This comment has been minimized.
dbendelman
commented
May 6, 2018
|
@dsvensson @PatrickOsborne this might be of interest: #2357 (comment) |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
dsvensson commentedOct 31, 2017
•
edited
What did you do?
Started prometheus under docker-compose.
What did you expect to see?
Nothing.
What did you see instead? Under which circumstances?
Lots of log INFO's that I want to hide.
Environment
prom/prometheus docker container.
System information:
docker
Prometheus version:
2.0.0-rc2
Logs:
Turns out Prometheus doesn't support adapting command line arguments based on Docker environment variables, which requires copying the whole ENTRYPOINT/CMD from the prom/prometheus Dockerfile:
...and pasteing into
docker-compose.yml, with--log.level=warnadded:Ideally this would be possible to either override via Docker environment variables.
Here is how log.level can be overridden for Grafana in
docker-compose.yml:Maybe something like:
Which would synthesize a
--log.level=warncommand line argument from a wrapper entrypoint script that traps PROM_ environment variables. This would not require any modifications to Prometheus itself, and would not add any extra way of configuring Prometheus. Just exposing control over the command line todocker-compose.yml.