FROM openshift/golang-builder:rhel_8_golang_1.16
ENV __doozer=update BUILD_RELEASE=202110182323.p0.git.03842e0.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202110182323.p0.git.03842e0.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=03842e0 OS_GIT_VERSION=4.9.0-202110182323.p0.git.03842e0.assembly.stream-03842e0 SOURCE_DATE_EPOCH=1629852795 SOURCE_GIT_COMMIT=03842e05c3530786315e436522471667af86627e SOURCE_GIT_TAG=v3.11.0-817-g03842e05 SOURCE_GIT_URL=https://github.com/openshift/telemeter 
ENV GOFLAGS="-mod=vendor"
COPY . /go/src/github.com/openshift/telemeter
RUN cd /go/src/github.com/openshift/telemeter && \
    go build ./cmd/telemeter-client && \
    go build ./cmd/telemeter-server && \
    go build ./cmd/authorization-server

FROM openshift/ose-base:v4.9.0.20211018.233142
ENV __doozer=update BUILD_RELEASE=202110182323.p0.git.03842e0.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202110182323.p0.git.03842e0.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=03842e0 OS_GIT_VERSION=4.9.0-202110182323.p0.git.03842e0.assembly.stream-03842e0 SOURCE_DATE_EPOCH=1629852795 SOURCE_GIT_COMMIT=03842e05c3530786315e436522471667af86627e SOURCE_GIT_TAG=v3.11.0-817-g03842e05 SOURCE_GIT_URL=https://github.com/openshift/telemeter 

COPY --from=0 /go/src/github.com/openshift/telemeter/telemeter-client /usr/bin/
COPY --from=0 /go/src/github.com/openshift/telemeter/telemeter-server /usr/bin/
COPY --from=0 /go/src/github.com/openshift/telemeter/authorization-server /usr/bin/

LABEL \
        io.k8s.display-name="OpenShift Telemeter" \
        io.k8s.description="" \
        io.openshift.tags="openshift,monitoring" \
        summary="" \
        maintainer="OpenShift Monitoring Team <team-monitoring@redhat.com>" \
        name="openshift/ose-telemeter" \
        com.redhat.component="telemeter-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Monitoring" \
        release="202110182323.p0.git.03842e0.assembly.stream" \
        io.openshift.build.commit.id="03842e05c3530786315e436522471667af86627e" \
        io.openshift.build.source-location="https://github.com/openshift/telemeter" \
        io.openshift.build.commit.url="https://github.com/openshift/telemeter/commit/03842e05c3530786315e436522471667af86627e" \
        version="v4.9.0"

