FROM openshift/golang-builder:1.12 AS builder
ENV __doozer=update BUILD_RELEASE=202005041055 BUILD_VERSION=v4.3.19 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=19 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.19-202005041055 
ENV __doozer=merge OS_GIT_COMMIT=97050f2 OS_GIT_VERSION=4.3.19-202005041055-97050f2 SOURCE_DATE_EPOCH=1587109434 SOURCE_GIT_COMMIT=97050f23a6774c55d66aad271e2a73e76c95cccb SOURCE_GIT_TAG=97050f23 SOURCE_GIT_URL=https://github.com/openshift/console-operator 
WORKDIR /go/src/github.com/openshift/console-operator
COPY . .
RUN ADDITIONAL_GOTAGS="ocp" make build WHAT="cmd/console"; \
    mkdir -p /tmp/build; \
    cp /go/src/github.com/openshift/console-operator/_output/local/bin/linux/$(go env GOARCH)/console /tmp/build/console

FROM openshift/ose-base:v4.3.19.20200504.105538
ENV __doozer=update BUILD_RELEASE=202005041055 BUILD_VERSION=v4.3.19 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=19 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.19-202005041055 
ENV __doozer=merge OS_GIT_COMMIT=97050f2 OS_GIT_VERSION=4.3.19-202005041055-97050f2 SOURCE_DATE_EPOCH=1587109434 SOURCE_GIT_COMMIT=97050f23a6774c55d66aad271e2a73e76c95cccb SOURCE_GIT_TAG=97050f23 SOURCE_GIT_URL=https://github.com/openshift/console-operator 
RUN useradd console-operator
USER console-operator
COPY --from=builder /tmp/build/console /usr/bin/console

# these manifests are necessary for the installer
COPY manifests /manifests/

# extensions manifests generated from openshift/api types
COPY vendor/github.com/openshift/api/console/v1/*.yaml /manifests/
COPY vendor/github.com/openshift/api/operator/v1/0000_70_console-operator.crd.yaml /manifests/



# entrypoint specified in 03-operator.yaml as `console-operator`
# CMD ["/usr/bin/console", "operator", "--kubeconfig", "path/to/config", "--config", "./install/config.yaml", "--v", "4"]
# CMD ["/usr/bin/console", "operator", "--v", "4"]

LABEL \
        io.k8s.display-name="OpenShift console-operator" \
        io.k8s.description="This is a component of OpenShift Container Platform and manages the lifecycle of the web console." \
        io.openshift.tags="openshift" \
        maintainer="Benjamin A. Petersen <bpetersen@redhat.com>" \
        io.openshift.release.operator="true" \
        name="openshift/ose-console-operator" \
        com.redhat.component="openshift-enterprise-console-operator-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Management Console" \
        version="v4.3.19" \
        release="202005041055" \
        io.openshift.build.commit.id="97050f23a6774c55d66aad271e2a73e76c95cccb" \
        io.openshift.build.source-location="https://github.com/openshift/console-operator" \
        io.openshift.build.commit.url="https://github.com/openshift/console-operator/commit/97050f23a6774c55d66aad271e2a73e76c95cccb"

