FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=514189dfbb8edf9818ba02d43f67fd4bbbf484a5 SOURCE_DATE_EPOCH=1574331417 BUILD_VERSION=v4.1.27 SOURCE_GIT_URL=https://github.com/openshift/cluster-kube-apiserver-operator SOURCE_GIT_TAG=514189df BUILD_RELEASE=201912030019
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.27.20191203.001959
ENV SOURCE_GIT_COMMIT=514189dfbb8edf9818ba02d43f67fd4bbbf484a5 SOURCE_DATE_EPOCH=1574331417 BUILD_VERSION=v4.1.27 SOURCE_GIT_URL=https://github.com/openshift/cluster-kube-apiserver-operator SOURCE_GIT_TAG=514189df BUILD_RELEASE=201912030019
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/514189dfbb8edf9818ba02d43f67fd4bbbf484a5" \
        version="v4.1.27" \
        io.openshift.build.commit.id="514189dfbb8edf9818ba02d43f67fd4bbbf484a5" \
        release="201912030019"

