FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202009041228.p0 BUILD_VERSION=v4.5.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=5 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.5.0-202009041228.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=cfcfdbd OS_GIT_VERSION=4.5.0-202009041228.p0-cfcfdbd SOURCE_DATE_EPOCH=1586852462 SOURCE_GIT_COMMIT=cfcfdbd150015fdc4a158c366942c01bbf32aa61 SOURCE_GIT_TAG=v0.1.0-42-gcfcfdbd SOURCE_GIT_URL=https://github.com/openshift/prom-label-proxy 

COPY . /go/src/github.com/openshift/prom-label-proxy
ENV GOFLAGS="-mod=vendor"
RUN cd /go/src/github.com/openshift/prom-label-proxy && make build; \
    mkdir -p /tmp/build; \
    cp /go/src/github.com/openshift/prom-label-proxy/_output/linux/$(go env GOARCH)/prom-label-proxy /tmp/build/prom-label-proxy

FROM openshift/ose-base:ubi7
ENV __doozer=update BUILD_RELEASE=202009041228.p0 BUILD_VERSION=v4.5.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=5 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.5.0-202009041228.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=cfcfdbd OS_GIT_VERSION=4.5.0-202009041228.p0-cfcfdbd SOURCE_DATE_EPOCH=1586852462 SOURCE_GIT_COMMIT=cfcfdbd150015fdc4a158c366942c01bbf32aa61 SOURCE_GIT_TAG=v0.1.0-42-gcfcfdbd SOURCE_GIT_URL=https://github.com/openshift/prom-label-proxy 
COPY --from=builder /tmp/build/prom-label-proxy /usr/bin/prom-kube-proxy


# doesn't require a root user.
USER 1001
ENTRYPOINT ["/usr/bin/prom-kube-proxy"]

LABEL \
        io.k8s.display-name="" \
        io.k8s.description="" \
        io.openshift.tags="prometheus" \
        maintainer="Frederic Branczyk <fbranczy@redhat.com>" \
        name="openshift/ose-prom-label-proxy" \
        com.redhat.component="prom-label-proxy-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Monitoring" \
        release="202009041228.p0" \
        io.openshift.build.commit.id="cfcfdbd150015fdc4a158c366942c01bbf32aa61" \
        io.openshift.build.source-location="https://github.com/openshift/prom-label-proxy" \
        io.openshift.build.commit.url="https://github.com/openshift/prom-label-proxy/commit/cfcfdbd150015fdc4a158c366942c01bbf32aa61" \
        version="v4.5.0"

