Introduce prometheus-webhook-snmp for Alertmanager

prometheus-webhook-snmp version: 1.4

Change-Id: I4645162d9497013eecc6c0513400d048a2792459
This commit is contained in:
Xiaoguang(William) Zhang 2020-09-23 16:55:13 +00:00
parent e0be1bab7c
commit d98dc86825
4 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,46 @@
ARG FROM=docker.io/ubuntu:bionic
FROM ${FROM}
ENV PYTHONUNBUFFERED 1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1
# ensure local python is preferred over distribution python
ENV PATH /usr/local/bin:$PATH
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
LABEL maintainer="Openstack-image Authors"
ARG BUILD_DATE=now
ARG VCS_REF
ARG VCS_URL
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.url="https://github.com/SUSE/prometheus-webhook-snmp" \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.version=$VERSION
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install --no-install-recommends \
curl \
wget \
gcc \
python3.7 \
python3-pip \
python3-venv \
git
RUN git clone -b v${VERSION} --single-branch --depth 1 https://github.com/SUSE/prometheus-webhook-snmp.git
RUN pip3 --no-cache-dir install --upgrade setuptools && \
pip3 --no-cache-dir install -r /prometheus-webhook-snmp/requirements.txt
ENV RUN_ARGS=""
EXPOSE 9099
ENTRYPOINT [ "/prometheus-webhook-snmp/prometheus-webhook-snmp", "run" ]

View File

@ -0,0 +1,21 @@
#!make
#-include .env .env.local .env.*.local
VCS_REF=$(shell git rev-parse --short HEAD)
BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
VERSION:=$(shell cat VERSION)
IMAGE_NAME=prometheus-webhook-snmp
.PHONY: version
build:
docker build \
--build-arg VCS_REF=$(VCS_REF) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
--build-arg VERSION=$(VERSION) \
-t $(IMAGE_NAME):$(VERSION) .
env:
env

View File

@ -0,0 +1 @@
1.4

View File

@ -0,0 +1,11 @@
#!/bin/bash
IMAGE="prometheus-webhook-snmp"
VERSION=${VERSION:-latest}
DISTRO=${DISTRO:-ubuntu_bionic}
REGISTRY_URI=${REGISTRY_URI:-"openstackhelm/"}
EXTRA_TAG_INFO=${EXTRA_TAG_INFO:-""}
echo "build hook starting..."
make build
echo "build hook completed."