# FROM directives are overriden by CI system (both Prow CI and OSBS)
FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202110121348.p0.git.ddfb948.assembly.stream BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202110121348.p0.git.ddfb948.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=ddfb948 OS_GIT_VERSION=4.6.0-202110121348.p0.git.ddfb948.assembly.stream-ddfb948 SOURCE_DATE_EPOCH=1610670961 SOURCE_GIT_COMMIT=ddfb948a847563191515bd7edeb77e7a1deed596 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-595-gddfb948a 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.6.0.20211012.140755
ENV __doozer=update BUILD_RELEASE=202110121348.p0.git.ddfb948.assembly.stream BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202110121348.p0.git.ddfb948.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=ddfb948 OS_GIT_VERSION=4.6.0-202110121348.p0.git.ddfb948.assembly.stream-ddfb948 SOURCE_DATE_EPOCH=1610670961 SOURCE_GIT_COMMIT=ddfb948a847563191515bd7edeb77e7a1deed596 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-595-gddfb948a 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="202110121348.p0.git.ddfb948.assembly.stream" \
        io.openshift.build.commit.id="ddfb948a847563191515bd7edeb77e7a1deed596" \
        io.openshift.build.source-location="https://github.com/openshift/prometheus-alertmanager" \
        io.openshift.build.commit.url="https://github.com/openshift/prometheus-alertmanager/commit/ddfb948a847563191515bd7edeb77e7a1deed596" \
        version="v4.6.0"

