FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=606ea77a0a8bd77d501520ed4fa89783cd7db187 SOURCE_DATE_EPOCH=1564937689 BUILD_VERSION=v4.1.10 SOURCE_GIT_URL=https://github.com/openshift/cluster-kube-apiserver-operator SOURCE_GIT_TAG=606ea77a BUILD_RELEASE=201908061216
WORKDIR /go/src/github.com/openshift/cluster-kube-apiserver-operator
COPY . .
ENV GO_PACKAGE github.com/openshift/cluster-kube-apiserver-operator
RUN go build -ldflags "-X $GO_PACKAGE/pkg/version.versionFromGit=$(git describe --long --tags --abbrev=7 --match 'v[0-9]*')" ./cmd/cluster-kube-apiserver-operator

FROM openshift/ose-base:v4.1.10.20190806.121629
ENV SOURCE_GIT_COMMIT=606ea77a0a8bd77d501520ed4fa89783cd7db187 SOURCE_DATE_EPOCH=1564937689 BUILD_VERSION=v4.1.10 SOURCE_GIT_URL=https://github.com/openshift/cluster-kube-apiserver-operator SOURCE_GIT_TAG=606ea77a BUILD_RELEASE=201908061216
RUN mkdir -p /usr/share/bootkube/manifests
COPY --from=builder /go/src/github.com/openshift/cluster-kube-apiserver-operator/bindata/bootkube/* /usr/share/bootkube/manifests/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-apiserver-operator/cluster-kube-apiserver-operator /usr/bin/
COPY manifests/*.yaml /manifests
COPY manifests/image-references /manifests
# FIXME: entrypoint shouldn't be bash but the binary (needs fixing the chain)
# ENTRYPOINT ["/usr/bin/cluster-kube-apiserver-operator"]

LABEL \
        com.redhat.component="ose-cluster-kube-apiserver-operator-container" \
        name="openshift/ose-cluster-kube-apiserver-operator" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-kube-apiserver-operator" \
        io.openshift.release.operator="true" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-kube-apiserver-operator/commit/606ea77a0a8bd77d501520ed4fa89783cd7db187" \
        version="v4.1.10" \
        io.openshift.build.commit.id="606ea77a0a8bd77d501520ed4fa89783cd7db187" \
        release="201908061216"

