Skip to content

Instantly share code, notes, and snippets.

@jiacai2050
Created January 9, 2020 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiacai2050/1fd35a03e8135059e432632642b91924 to your computer and use it in GitHub Desktop.
Save jiacai2050/1fd35a03e8135059e432632642b91924 to your computer and use it in GitHub Desktop.
custom prometheus docker file
FROM prom/prometheus:v2.12.0
COPY ./start.sh /start.sh
ENTRYPOINT ["/start.sh"]
CMD []
#!/bin/sh
set -x
exec /bin/prometheus --config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/prometheus \
--web.console.libraries=/usr/share/prometheus/console_libraries \
--web.console.templates=/usr/share/prometheus/consoles \
--storage.tsdb.retention.time=${PROM_RETENTION_TIME:-15d} \
${PROM_EXTRA_ARGS}
@jiacai2050
Copy link
Author

The default prometheus dockerfile isn't very suitable for custom, if one want provide some flags, they have to provide all flags since docker will overwrite CMD rather than append them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment