FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=227189dae8e64eca5ad13a8bb96df8d8d5502f35 SOURCE_GIT_TAG=227189d SOURCE_GIT_URL=https://github.com/openshift/kubecsr SOURCE_DATE_EPOCH=1562904198 BUILD_VERSION=v4.2.18 BUILD_RELEASE=202002031246

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

COPY . .

RUN make bin/kube-client-agent

# stage 2
FROM openshift/ose-base:v4.2.18.20200203.124646
ENV SOURCE_GIT_COMMIT=227189dae8e64eca5ad13a8bb96df8d8d5502f35 SOURCE_GIT_TAG=227189d SOURCE_GIT_URL=https://github.com/openshift/kubecsr SOURCE_DATE_EPOCH=1562904198 BUILD_VERSION=v4.2.18 BUILD_RELEASE=202002031246

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" \
        version="v4.2.18" \
        release="202002031246" \
        io.openshift.build.commit.id="227189dae8e64eca5ad13a8bb96df8d8d5502f35" \
        io.openshift.build.source-location="https://github.com/openshift/kubecsr" \
        io.openshift.build.commit.url="https://github.com/openshift/kubecsr/commit/227189dae8e64eca5ad13a8bb96df8d8d5502f35"

