# FROM directives are overriden by CI system (both Prow CI and OSBS)
FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS builder
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g0133959.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g0133959.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=0133959 OS_GIT_VERSION=4.10.0-202202160023.p0.g0133959.assembly.stream-0133959 SOURCE_DATE_EPOCH=1638982939 SOURCE_GIT_COMMIT=013395968b37eb66909d7bbee7e34249b120835e SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-946-g01339596 SOURCE_GIT_URL=https://github.com/openshift/prometheus-alertmanager 
WORKDIR /go/src/github.com/prometheus/alertmanager
COPY . .
RUN if yum install -y prometheus-promu; then export BUILD_PROMU=false; fi && make build

FROM openshift/base-rhel8:v4.10.0.20220216.010142
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g0133959.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g0133959.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=0133959 OS_GIT_VERSION=4.10.0-202202160023.p0.g0133959.assembly.stream-0133959 SOURCE_DATE_EPOCH=1638982939 SOURCE_GIT_COMMIT=013395968b37eb66909d7bbee7e34249b120835e SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-946-g01339596 SOURCE_GIT_URL=https://github.com/openshift/prometheus-alertmanager 

ARG ALERTMANAGER_GOPATH=/go/src/github.com/prometheus/alertmanager
COPY --from=builder ${ALERTMANAGER_GOPATH}/amtool                       /bin/amtool
COPY --from=builder ${ALERTMANAGER_GOPATH}/alertmanager                 /bin/alertmanager
COPY --from=builder ${ALERTMANAGER_GOPATH}/examples/ha/alertmanager.yml /etc/alertmanager/alertmanager.yml

EXPOSE     9093
RUN mkdir -p /alertmanager
VOLUME     [ "/alertmanager" ]
WORKDIR    /etc/alertmanager
ENTRYPOINT [ "/bin/alertmanager" ]
CMD        [ "--storage.path=/alertmanager" ]

LABEL \
        io.k8s.display-name="Prometheus Alert Manager" \
        io.k8s.description="This is the Prometheus Alert Manager image." \
        io.openshift.tags="openshift,prometheus" \
        summary="Prometheus Alert Manager" \
        maintainer="OpenShift Monitoring Team <team-monitoring@redhat.com>" \
        License="ASL 2.0" \
        vendor="Red Hat" \
        name="openshift/ose-prometheus-alertmanager" \
        com.redhat.component="golang-github-prometheus-alertmanager-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Monitoring" \
        release="202202160023.p0.g0133959.assembly.stream" \
        io.openshift.build.commit.id="013395968b37eb66909d7bbee7e34249b120835e" \
        io.openshift.build.source-location="https://github.com/openshift/prometheus-alertmanager" \
        io.openshift.build.commit.url="https://github.com/openshift/prometheus-alertmanager/commit/013395968b37eb66909d7bbee7e34249b120835e" \
        version="v4.10.0"

