FROM openshift/golang-builder:1.10 AS builder
ENV SOURCE_GIT_COMMIT=a43debdf343189438f7173f78200d374d95a52f9 SOURCE_DATE_EPOCH=1555005630 BUILD_VERSION=v4.1.25 SOURCE_GIT_URL=https://github.com/openshift/prom-label-proxy SOURCE_GIT_TAG=v0.1.0-9-ga43debd BUILD_RELEASE=201911190028

COPY . /go/src/github.com/openshift/prom-label-proxy
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 SOURCE_GIT_COMMIT=a43debdf343189438f7173f78200d374d95a52f9 SOURCE_DATE_EPOCH=1555005630 BUILD_VERSION=v4.1.25 SOURCE_GIT_URL=https://github.com/openshift/prom-label-proxy SOURCE_GIT_TAG=v0.1.0-9-ga43debd BUILD_RELEASE=201911190028
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.description="" \
        com.redhat.component="prom-label-proxy-container" \
        maintainer="Frederic Branczyk <fbranczy@redhat.com>" \
        name="openshift/ose-prom-label-proxy" \
        io.k8s.display-name="" \
        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/a43debdf343189438f7173f78200d374d95a52f9" \
        version="v4.1.25" \
        io.openshift.build.commit.id="a43debdf343189438f7173f78200d374d95a52f9" \
        release="201911190028" \
        io.openshift.tags="prometheus"

