FROM openshift/golang-builder:1.10 AS builder
ENV SOURCE_GIT_COMMIT=004fb206a4e478299604b85d7f71988820947038 SOURCE_GIT_TAG=004fb20 SOURCE_DATE_EPOCH=1556260701

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

COPY . .

RUN make bin/kube-etcd-signer-server

# stage 2
FROM openshift/ose-base:v4.1.6.20190710.122447
ENV SOURCE_GIT_COMMIT=004fb206a4e478299604b85d7f71988820947038 SOURCE_GIT_TAG=004fb20 SOURCE_DATE_EPOCH=1556260701

ENTRYPOINT ["/usr/bin/kube-etcd-signer-server"]

COPY --from=builder /go/src/github.com/coreos/kubecsr/bin/kube-etcd-signer-server /usr/bin/

LABEL \
        io.k8s.description="The certificate signer approves a given valid CSR provided by the client agent and returns a signed certificate." \
        com.redhat.component="ose-kube-etcd-signer-server-container" \
        maintainer="Sam Batschelet <sbatsche@redhat.com>" \
        name="openshift/ose-kube-etcd-signer-server" \
        License="Apache 2.0" \
        io.k8s.display-name="kube-etcd-signer-server" \
        io.openshift.build.source-location="https://github.com/openshift/kubecsr" \
        io.openshift.build.commit.url="https://github.com/openshift/kubecsr/commit/004fb206a4e478299604b85d7f71988820947038" \
        version="v4.1.6" \
        io.openshift.build.commit.id="004fb206a4e478299604b85d7f71988820947038" \
        release="201907101224" \
        io.openshift.tags="kube-etcd-signer-server"

