FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=d33d94740aae9f80999a30b89c4c3e7de43f2205 SOURCE_DATE_EPOCH=1567499227 BUILD_VERSION=v4.1.23 SOURCE_GIT_URL=https://github.com/openshift/cluster-kube-apiserver-operator SOURCE_GIT_TAG=d33d9474 BUILD_RELEASE=201911050122
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.23.20191105.012243
ENV SOURCE_GIT_COMMIT=d33d94740aae9f80999a30b89c4c3e7de43f2205 SOURCE_DATE_EPOCH=1567499227 BUILD_VERSION=v4.1.23 SOURCE_GIT_URL=https://github.com/openshift/cluster-kube-apiserver-operator SOURCE_GIT_TAG=d33d9474 BUILD_RELEASE=201911050122
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/d33d94740aae9f80999a30b89c4c3e7de43f2205" \
        version="v4.1.23" \
        io.openshift.build.commit.id="d33d94740aae9f80999a30b89c4c3e7de43f2205" \
        release="201911050122"

