Skip to content

Commit

Permalink
Add Prometheus Jiralert container
Browse files Browse the repository at this point in the history
This uses the binary release from GitHub.

Change-Id: Id7df96e7d5b646d4b42e06945bafdbce828b902b
Co-Authored-By: Pierre Riteau <[email protected]>
(cherry picked from commit 034419e)
(cherry picked from commit 49dd6d3)
  • Loading branch information
dougszumski authored and markgoddard committed Jun 17, 2022
1 parent 2a9ccf0 commit 4ffed74
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docker/prometheus/prometheus-jiralert/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM {{ namespace }}/{{ infra_image_prefix }}prometheus-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% import "macros.j2" as macros with context %}

{% block prometheus_jiralert_header %}{% endblock %}

{% if base_package_type == 'rpm' %}
{% set prometheus_jiralert_packages = [
'go',
] %}
{% elif base_package_type == 'deb' %}
{% set prometheus_jiralert_packages = [
'golang-go',
] %}
{% endif %}

{{ macros.install_packages(prometheus_jiralert_packages | customizable("packages")) }}

{% block prometheus_jiralert_version %}
ARG prometheus_jiralert_version=1.0
ARG prometheus_jiralert_url=https://github.com/prometheus-community/jiralert/releases/download/${prometheus_jiralert_version}/jiralert-${prometheus_jiralert_version}.linux-{{debian_arch}}.tar.gz
{% endblock %}

{% block prometheus_jiralert_install %}
ENV GOPATH=/tmp
RUN curl -o /tmp/jiralert.tar.gz ${prometheus_jiralert_url} \
&& mkdir /opt/jiralert \
&& tar --strip 1 -xvf /tmp/jiralert.tar.gz -C /opt/jiralert \
&& rm -f /tmp/jiralert.tar.gz \
&& mkdir -p /etc/jiralert
{% endblock %}

{% block prometheus_jiralert_footer %}{% endblock %}
{% block footer %}{% endblock %}

USER prometheus

0 comments on commit 4ffed74

Please sign in to comment.