FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202101230441.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-202101230441.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=f811b8c OS_GIT_VERSION=4.5.0-202101230441.p0-f811b8c SOURCE_DATE_EPOCH=1602712196 SOURCE_GIT_COMMIT=f811b8c1cf5b720e8f53c22fc39e24cabbcffdda SOURCE_GIT_TAG=f811b8c SOURCE_GIT_URL=https://github.com/openshift/kubecsr 

WORKDIR /go/src/github.com/coreos/kubecsr

COPY . .

RUN make bin/kube-client-agent

# stage 2
FROM openshift/ose-base:v4.5.0.20210123.050934
ENV __doozer=update BUILD_RELEASE=202101230441.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-202101230441.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=f811b8c OS_GIT_VERSION=4.5.0-202101230441.p0-f811b8c SOURCE_DATE_EPOCH=1602712196 SOURCE_GIT_COMMIT=f811b8c1cf5b720e8f53c22fc39e24cabbcffdda SOURCE_GIT_TAG=f811b8c SOURCE_GIT_URL=https://github.com/openshift/kubecsr 

ENTRYPOINT ["/usr/bin/kube-client-agent"]

COPY --from=builder /go/src/github.com/coreos/kubecsr/bin/kube-client-agent /usr/bin/

LABEL \
        io.k8s.display-name="kube-client-agent" \
        io.k8s.description="This client agent generates a valid CSR according to the configuration flags provided to it." \
        maintainer="Sam Batschelet <sbatsche@redhat.com>" \
        License="Apache 2.0" \
        io.openshift.tags="kube-client-agent" \
        name="openshift/ose-kube-client-agent" \
        com.redhat.component="ose-kube-client-agent-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        release="202101230441.p0" \
        io.openshift.build.commit.id="f811b8c1cf5b720e8f53c22fc39e24cabbcffdda" \
        io.openshift.build.source-location="https://github.com/openshift/kubecsr" \
        io.openshift.build.commit.url="https://github.com/openshift/kubecsr/commit/f811b8c1cf5b720e8f53c22fc39e24cabbcffdda" \
        version="v4.5.0"

